Class Socks4LogicHandler
- java.lang.Object
-
- org.apache.mina.proxy.AbstractProxyLogicHandler
-
- org.apache.mina.proxy.handlers.socks.AbstractSocksLogicHandler
-
- org.apache.mina.proxy.handlers.socks.Socks4LogicHandler
-
- All Implemented Interfaces:
ProxyLogicHandler
public class Socks4LogicHandler extends AbstractSocksLogicHandler
Socks4LogicHandler.java - SOCKS4/SOCKS4a authentication mechanisms logic handler.- Since:
- MINA 2.0.0-M3
- Author:
- Apache MINA Project
-
-
Field Summary
-
Fields inherited from class org.apache.mina.proxy.handlers.socks.AbstractSocksLogicHandler
request
-
-
Constructor Summary
Constructors Constructor Description Socks4LogicHandler(ProxyIoSession proxyIoSession)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doHandshake(IoFilter.NextFilter nextFilter)
Perform the handshake.protected void
handleResponse(IoBuffer buf)
Handle a SOCKS4/SOCKS4a response from the proxy server.void
messageReceived(IoFilter.NextFilter nextFilter, IoBuffer buf)
Handle incoming data during the handshake process.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.-
Methods inherited from class org.apache.mina.proxy.AbstractProxyLogicHandler
closeSession, closeSession, enqueueWriteRequest, flushPendingWriteRequests, getProxyFilter, getProxyIoSession, getSession, isHandshakeComplete, setHandshakeComplete, writeData
-
-
-
-
Constructor Detail
-
Socks4LogicHandler
public Socks4LogicHandler(ProxyIoSession proxyIoSession)
- Parameters:
proxyIoSession
- The original session- See Also:
AbstractSocksLogicHandler(ProxyIoSession)
-
-
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 filterrequest
- 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 filterbuf
- 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 callAbstractProxyLogicHandler.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.
-
-