/** * Creates a new {@link AbstractSocksLogicHandler}. * * @param proxyIoSession the proxy session object */ public AbstractSocksLogicHandler(final ProxyIoSession proxyIoSession) { super(proxyIoSession); this.request = (SocksProxyRequest) proxyIoSession.getRequest(); } }
/** * Creates a new {@link AbstractSocksLogicHandler}. * * @param proxyIoSession the proxy session object */ public AbstractSocksLogicHandler(final ProxyIoSession proxyIoSession) { super(proxyIoSession); this.request = (SocksProxyRequest) proxyIoSession.getRequest(); } }
/** * Creates a new {@link AbstractSocksLogicHandler}. * * @param proxyIoSession the proxy session object */ public AbstractSocksLogicHandler(final ProxyIoSession proxyIoSession) { super(proxyIoSession); this.request = (SocksProxyRequest) proxyIoSession.getRequest(); } }
/** * 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"); } }
/** * Instantiates a handler for the given proxy session. * * @param proxyIoSession the proxy session object * @throws ProxyAuthException */ 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"); } }
/** * Hooked session opened event. * * @param session the io session */ @Override public final void sessionOpened(IoSession session) throws Exception { ProxyIoSession proxyIoSession = (ProxyIoSession) session.getAttribute(ProxyIoSession.PROXY_SESSION); if (proxyIoSession.getRequest() instanceof SocksProxyRequest || proxyIoSession.isAuthenticationFailed() || proxyIoSession.getHandler().isHandshakeComplete()) { proxySessionOpened(session); } else { logger.debug("Filtered session opened event !"); } } }
/** * Hooked session opened event. * * @param session the io session */ @Override public final void sessionOpened(IoSession session) throws Exception { ProxyIoSession proxyIoSession = (ProxyIoSession) session.getAttribute(ProxyIoSession.PROXY_SESSION); if (proxyIoSession.getRequest() instanceof SocksProxyRequest || proxyIoSession.isAuthenticationFailed() || proxyIoSession.getHandler().isHandshakeComplete()) { proxySessionOpened(session); } else { logger.debug("Filtered session opened event !"); } } }
/** * Hooked session opened event. * * @param session the io session */ @Override public final void sessionOpened(IoSession session) throws Exception { ProxyIoSession proxyIoSession = (ProxyIoSession) session .getAttribute(ProxyIoSession.PROXY_SESSION); if (proxyIoSession.getRequest() instanceof SocksProxyRequest || proxyIoSession.isAuthenticationFailed() || proxyIoSession.getHandler().isHandshakeComplete()) { proxySessionOpened(session); } else { logger.debug("Filtered session opened event !"); } } }
/** * Performs the handshake processing. * * @param nextFilter the next filter */ @Override public void doHandshake(final NextFilter nextFilter) throws ProxyAuthException { logger.debug(" doHandshake()"); if (authHandler != null) { authHandler.doHandshake(nextFilter); } else { if (requestSent) { // Safety check throw new ProxyAuthException("Authentication request already sent"); } logger.debug(" sending HTTP request"); // Compute request headers HttpProxyRequest req = (HttpProxyRequest) getProxyIoSession().getRequest(); Map<String, List<String>> headers = req.getHeaders() != null ? req.getHeaders() : new HashMap<String, List<String>>(); AbstractAuthLogicHandler.addKeepAliveHeaders(headers); req.setHeaders(headers); // Write request to the proxy writeRequest(nextFilter, req); requestSent = true; } }
/** * Performs the handshake processing. * * @param nextFilter the next filter */ @Override public void doHandshake(final NextFilter nextFilter) throws ProxyAuthException { logger.debug(" doHandshake()"); if (authHandler != null) { authHandler.doHandshake(nextFilter); } else { if (requestSent) { // Safety check throw new ProxyAuthException("Authentication request already sent"); } logger.debug(" sending HTTP request"); // Compute request headers HttpProxyRequest req = (HttpProxyRequest) getProxyIoSession().getRequest(); Map<String, List<String>> headers = req.getHeaders() != null ? req.getHeaders() : new HashMap<String, List<String>>(); AbstractAuthLogicHandler.addKeepAliveHeaders(headers); req.setHeaders(headers); // Write request to the proxy writeRequest(nextFilter, req); requestSent = true; } }
/** * Performs the handshake processing. * * @param nextFilter the next filter */ public void doHandshake(final NextFilter nextFilter) throws ProxyAuthException { logger.debug(" doHandshake()"); if (authHandler != null) { authHandler.doHandshake(nextFilter); } else { if (requestSent) { // Safety check throw new ProxyAuthException( "Authentication request already sent"); } logger.debug(" sending HTTP request"); // Compute request headers HttpProxyRequest req = (HttpProxyRequest) getProxyIoSession() .getRequest(); Map<String, List<String>> headers = req.getHeaders() != null ? req .getHeaders() : new HashMap<>(); AbstractAuthLogicHandler.addKeepAliveHeaders(headers); req.setHeaders(headers); // Write request to the proxy writeRequest(nextFilter, req); requestSent = true; } }
if (proxyIoSession.getRequest() instanceof SocksProxyRequest || proxyIoSession.isReconnectionNeeded()) { return conFuture;
if (proxyIoSession.getRequest() instanceof SocksProxyRequest || proxyIoSession.isReconnectionNeeded()) { return conFuture;
if (proxyIoSession.getRequest() instanceof SocksProxyRequest || proxyIoSession.isReconnectionNeeded()) { return conFuture;
ProxyRequest request = proxyIoSession.getRequest();
ProxyRequest request = proxyIoSession.getRequest();
logger.debug("??? >> Enqueue {}", evt); if (proxyIoSession.getRequest() instanceof SocksProxyRequest) {
logger.debug("??? >> Enqueue {}", evt); if (proxyIoSession.getRequest() instanceof SocksProxyRequest) {
logger.debug("??? >> Enqueue {}", evt); if (proxyIoSession.getRequest() instanceof SocksProxyRequest) {