我像这样在 httpasyncclient 上使用代理:
final CloseableHttpAsyncClient httpclient = HttpAsyncClients
.createDefault();
httpclient.start();
final HttpGet request = new HttpGet("http://www.apache.org/");
HttpHost proxy = new HttpHost("127.0.0.1", 8888, "http");
RequestConfig config = RequestConfig.custom().setProxy(proxy).build();
request.setConfig(config);
final Future<HttpResponse> future = httpclient.execute(request, null);
System.out.println("Response: " + future.get().getStatusLine());
但是请求不通过代理获取数据。为什么?版本:httpasyncclient 4.0-beta4