String targetUrl = String.format("%s://127.0.0.1:%d/", secure ? "wss" : "ws", port2);
// CONNECT happens over HTTP, not HTTPS
ProxyServer ps = new ProxyServer(ProxyServer.Protocol.HTTP, "127.0.0.1", port1);
AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder().setProxyServer(ps).setAcceptAnyCertificate(true).build();
AsyncHttpClient asyncHttpClient = getAsyncHttpClient(config);
try {
final CountDownLatch latch = new CountDownLatch(1);
final AtomicReference<String> text = new AtomicReference<String>("");