}
@Test(groups = { "online", "default_provider" })
public void testSimpleAHCConfigProxy() throws IOException, InterruptedException, ExecutionException, TimeoutException {
SimpleAsyncHttpClient client = new SimpleAsyncHttpClient.Builder()//
.setProviderClass(getProviderClass())//
.setProxyProtocol(ProxyServer.Protocol.HTTPS)//
.setProxyHost("127.0.0.1")//
.setProxyPort(port1)//
.setFollowRedirect(true)//
.setUrl(getTargetUrl2())//
.setAcceptAnyCertificate(true)//
.setHeader("Content-Type", "text/html")//
.build();
try {
Response r = client.get().get();
assertEquals(r.getStatusCode(), 200);
assertEquals(r.getHeader("X-Connection"), "keep-alive");
} finally {
client.close();
}
}