Class Socks4LogicHandler

    • Method Detail

      • doHandshake

        public void doHandshake​(IoFilter.NextFilter nextFilter)
        Perform the handshake.
        Parameters:
        nextFilter - the next filter
      • writeRequest

        protected void writeRequest​(IoFilter.NextFilter nextFilter,
                                    SocksProxyRequest request)
        Encode a SOCKS4/SOCKS4a request and writes it to the next filter so it can be sent to the proxy server.
        Parameters:
        nextFilter - the next filter
        request - the request to send.
      • messageReceived

        public void messageReceived​(IoFilter.NextFilter nextFilter,
                                    IoBuffer buf)
        Handle incoming data during the handshake process. Should consume only the handshake data from the buffer, leaving any extra data in place.
        Parameters:
        nextFilter - the next filter
        buf - the server response data buffer
      • handleResponse

        protected void handleResponse​(IoBuffer buf)
                               throws Exception
        Handle a SOCKS4/SOCKS4a response from the proxy server. Test the response buffer reply code and call AbstractProxyLogicHandler.setHandshakeComplete() if access is granted.
        Parameters:
        buf - the buffer holding the server response data.
        Throws:
        Exception - if server response is malformed or if request is rejected by the proxy server.