JAVA使用代理服务器访问网络资源
需要在使用URL访问网络资源前,加入下面的代码。
?
System.getProperties().put("proxySet", "true"); //使用代理服务器System.getProperties().put("proxyHost", "192.168.1.1"); //代理服务器IPSystem.getProperties().put("proxyPort", "8080"); //代理服务器端口?
参考资料:http://xttifqqk.iteye.com/blog/602765