HttpClient 4的代理设置方法:

[java]
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(, ),
new UsernamePasswordCredentials(, ));
httpClient.setCredentialsProvider(credsProvider);
HttpHost proxy = new HttpHost(, , “http”);
httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,proxy);
[/java]

新版本中已经不使用这种方式,待更新。