HttpClient httpClient = new HttpClient();
// 设置代理
HostConfiguration hcf = new HostConfiguration();
hcf.setProxy("localhost", 8000);
httpClient.setHostConfiguration(hcf);
// 设置超时
HttpConnectionManagerParams managerParams = httpClient.getHttpConnectionManager().getParams();
// 设置连接超时时间(单位毫秒)
managerParams.setConnectionTimeout(30000);
// 设置读数据超时时间(单位毫秒)
managerParams.setSoTimeout(120000);