HttpClient4 设置代理

HttpClient4 设置代理

DefaultHttpClient client = new DefaultHttpClient();
HttpHost proxy = new HttpHost(ip, port);
client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);

编程技巧