/** * Constructor. * * @param proxyAddress the IP address of the proxy server * @param request the proxy request */ public ProxyIoSession(InetSocketAddress proxyAddress, ProxyRequest request) { setProxyAddress(proxyAddress); setRequest(request); }
/** * @return the proxy filter {@link ProxyFilter}. */ protected ProxyFilter getProxyFilter() { return proxyIoSession.getProxyFilter(); }
/** * @return the session. */ protected IoSession getSession() { return proxyIoSession.getSession(); }
@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); } });
/** * Creates a new {@link AbstractSocksLogicHandler}. * * @param proxyIoSession the proxy session object */ public AbstractSocksLogicHandler(final ProxyIoSession proxyIoSession) { super(proxyIoSession); this.request = (SocksProxyRequest) proxyIoSession.getRequest(); } }
/** * @return a charset instance of the in use charset name. */ public Charset getCharset() { return Charset.forName(getCharsetName()); }
/** * Sends an HTTP request. * * @param nextFilter the next filter * @param request the request to write * @throws ProxyAuthException If we get an error during the proxy authentication */ protected void writeRequest(final NextFilter nextFilter, final HttpProxyRequest request) throws ProxyAuthException { logger.debug(" sending HTTP request"); ((AbstractHttpLogicHandler) proxyIoSession.getHandler()).writeRequest(nextFilter, request); }
/** * Calls writeRequest0(NextFilter, HttpProxyRequest) to write the request. * If needed a reconnection to the proxy is done previously. * * @param nextFilter the next filter * @param request the http request */ public void writeRequest(final NextFilter nextFilter, final HttpProxyRequest request) { ProxyIoSession proxyIoSession = getProxyIoSession(); if (proxyIoSession.isReconnectionNeeded()) { reconnect(nextFilter, request); } else { writeRequest0(nextFilter, request); } }
/** * Constructor. * * @param proxyAddress the IP address of the proxy server * @param request the proxy request */ public ProxyIoSession(InetSocketAddress proxyAddress, ProxyRequest request) { setProxyAddress(proxyAddress); setRequest(request); }
/** * Creates a new {@link AbstractSocksLogicHandler}. * * @param proxyIoSession the proxy session object */ public AbstractSocksLogicHandler(final ProxyIoSession proxyIoSession) { super(proxyIoSession); this.request = (SocksProxyRequest) proxyIoSession.getRequest(); } }
/** * Returns the proxy filter {@link ProxyFilter}. */ protected ProxyFilter getProxyFilter() { return proxyIoSession.getProxyFilter(); }
/** * @return the session. */ protected IoSession getSession() { return proxyIoSession.getSession(); }
/** * @return a charset instance of the in use charset name. */ public Charset getCharset() { return Charset.forName(getCharsetName()); }
/** * Constructor. * * @param proxyAddress the IP address of the proxy server * @param request the proxy request */ public ProxyIoSession(InetSocketAddress proxyAddress, ProxyRequest request) { setProxyAddress(proxyAddress); setRequest(request); }
/** * Creates a new {@link AbstractSocksLogicHandler}. * * @param proxyIoSession the proxy session object */ public AbstractSocksLogicHandler(final ProxyIoSession proxyIoSession) { super(proxyIoSession); this.request = (SocksProxyRequest) proxyIoSession.getRequest(); } }
/** * @return the proxy filter {@link ProxyFilter}. */ protected ProxyFilter getProxyFilter() { return proxyIoSession.getProxyFilter(); }
/** * Returns the session. */ protected IoSession getSession() { return proxyIoSession.getSession(); }
/** * Returns a charset instance of the in use charset name. */ public Charset getCharset() { return Charset.forName(getCharsetName()); }
/** * Instantiates a handler for the given proxy session. * * @param proxyIoSession the proxy session object * @throws ProxyAuthException If we get an error during the proxy authentication */ protected AbstractAuthLogicHandler(final ProxyIoSession proxyIoSession) throws ProxyAuthException { this.proxyIoSession = proxyIoSession; this.request = proxyIoSession.getRequest(); if (this.request == null || !(this.request instanceof HttpProxyRequest)) { throw new IllegalArgumentException("request parameter should be a non null HttpProxyRequest instance"); } }
/** * Instantiates a handler for the given proxy session. * * @param proxyIoSession the proxy session object * @throws ProxyAuthException If we get an error during the proxy authentication */ protected AbstractAuthLogicHandler(final ProxyIoSession proxyIoSession) throws ProxyAuthException { this.proxyIoSession = proxyIoSession; this.request = proxyIoSession.getRequest(); if (this.request == null || !(this.request instanceof HttpProxyRequest)) { throw new IllegalArgumentException("request parameter should be a non null HttpProxyRequest instance"); } }