private boolean exitAfterHandlingConnect(// final Channel channel,// final NettyResponseFuture<?> future,// final Request request,// ProxyServer proxyServer,// int statusCode,// HttpRequest httpRequest) throws IOException { if (statusCode == OK.getCode() && httpRequest.getMethod() == HttpMethod.CONNECT) { if (future.isKeepAlive()) future.attachChannel(channel, true); try { Uri requestUri = request.getUri(); String scheme = requestUri.getScheme(); String host = requestUri.getHost(); int port = getDefaultPort(requestUri); logger.debug("Connecting to proxy {} for scheme {}", proxyServer, scheme); channelManager.upgradeProtocol(channel.getPipeline(), scheme, host, port); } catch (Throwable ex) { requestSender.abort(channel, future, ex); } future.setReuseChannel(true); future.setConnectAllowed(false); requestSender.sendNextRequest(new RequestBuilder(future.getRequest()).build(), future); return true; } return false; }
private boolean exitAfterHandlingConnect(// final Channel channel,// final NettyResponseFuture<?> future,// final Request request,// ProxyServer proxyServer,// int statusCode,// HttpRequest httpRequest) throws IOException { if (statusCode == OK.getCode() && httpRequest.getMethod() == HttpMethod.CONNECT) { if (future.isKeepAlive()) future.attachChannel(channel, true); try { UriComponents requestURI = request.getURI(); String scheme = requestURI.getScheme(); String host = requestURI.getHost(); int port = getDefaultPort(requestURI); logger.debug("Connecting to proxy {} for scheme {}", proxyServer, scheme); channelManager.upgradeProtocol(channel.getPipeline(), scheme, host, port); } catch (Throwable ex) { requestSender.abort(future, ex); } future.setReuseChannel(true); future.setConnectAllowed(false); requestSender.sendNextRequest(new RequestBuilder(future.getRequest()).build(), future); return true; } return false; }