@Override public void initializeSession(final IoSession session, ConnectFuture future) { LOGGER.debug("Initializing new session: {}", session); session.setAttribute(ProxyIoSession.PROXY_SESSION, proxyIoSession); proxyIoSession.setSession(session); LOGGER.debug(" setting up proxyIoSession: {}", proxyIoSession); // Reconnection is done so we send the // request to the proxy proxyIoSession.setReconnectionNeeded(false); writeRequest0(nextFilter, request); } });
@Override public void initializeSession(final IoSession session, ConnectFuture future) { LOGGER.debug("Initializing new session: {}", session); session.setAttribute(ProxyIoSession.PROXY_SESSION, proxyIoSession); proxyIoSession.setSession(session); LOGGER.debug(" setting up proxyIoSession: {}", proxyIoSession); // Reconnection is done so we send the // request to the proxy proxyIoSession.setReconnectionNeeded(false); writeRequest0(nextFilter, request); } });
/** * Handle a HTTP response from the proxy server. * * @param response The proxy response. */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { if (!isHandshakeComplete() && ("close".equalsIgnoreCase(StringUtilities.getSingleValuedHeader(response.getHeaders(), "Proxy-Connection")) || "close".equalsIgnoreCase(StringUtilities.getSingleValuedHeader( response.getHeaders(), "Connection")))) { getProxyIoSession().setReconnectionNeeded(true); } if (response.getStatusCode() == 407) { if (authHandler == null) { autoSelectAuthHandler(response); } authHandler.handleResponse(response); } else { throw new ProxyAuthException("Error: unexpected response code " + response.getStatusLine() + " received from proxy."); } } }
/** * Handle a HTTP response from the proxy server. * * @param response The proxy response. */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { if (!isHandshakeComplete() && ("close".equalsIgnoreCase(StringUtilities.getSingleValuedHeader(response.getHeaders(), "Proxy-Connection")) || "close".equalsIgnoreCase(StringUtilities.getSingleValuedHeader( response.getHeaders(), "Connection")))) { getProxyIoSession().setReconnectionNeeded(true); } if (response.getStatusCode() == 407) { if (authHandler == null) { autoSelectAuthHandler(response); } authHandler.handleResponse(response); } else { throw new ProxyAuthException("Error: unexpected response code " + response.getStatusLine() + " received from proxy."); } } }
/** * Handle a HTTP response from the proxy server. * * @param response The proxy response. */ @Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException { if (!isHandshakeComplete() && ("close".equalsIgnoreCase(StringUtilities .getSingleValuedHeader(response.getHeaders(), "Proxy-Connection")) || "close" .equalsIgnoreCase(StringUtilities .getSingleValuedHeader(response.getHeaders(), "Connection")))) { getProxyIoSession().setReconnectionNeeded(true); } if (response.getStatusCode() == 407) { if (authHandler == null) { autoSelectAuthHandler(response); } authHandler.handleResponse(response); } else { throw new ProxyAuthException("Error: unexpected response code " + response.getStatusLine() + " received from proxy."); } } }