Class Socks5LogicHandler
- java.lang.Object
-
- org.apache.mina.proxy.AbstractProxyLogicHandler
-
- org.apache.mina.proxy.handlers.socks.AbstractSocksLogicHandler
-
- org.apache.mina.proxy.handlers.socks.Socks5LogicHandler
-
- All Implemented Interfaces:
ProxyLogicHandler
public class Socks5LogicHandler extends AbstractSocksLogicHandler
Socks5LogicHandler.java - SOCKS5 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 Socks5LogicHandler(ProxyIoSession proxyIoSession)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeSession(String message)
Closes the session.void
doHandshake(IoFilter.NextFilter nextFilter)
Performs the handshake process.protected void
handleResponse(IoFilter.NextFilter nextFilter, IoBuffer buf, int step)
Handle a SOCKS v5 response from the proxy server.void
messageReceived(IoFilter.NextFilter nextFilter, IoBuffer buf)
Handles incoming data during the handshake process.-
Methods inherited from class org.apache.mina.proxy.AbstractProxyLogicHandler
closeSession, enqueueWriteRequest, flushPendingWriteRequests, getProxyFilter, getProxyIoSession, getSession, isHandshakeComplete, setHandshakeComplete, writeData
-
-
-
-
Constructor Detail
-
Socks5LogicHandler
public Socks5LogicHandler(ProxyIoSession proxyIoSession)
- Parameters:
proxyIoSession
- The original session- See Also:
AbstractSocksLogicHandler(ProxyIoSession)
-
-
Method Detail
-
doHandshake
public void doHandshake(IoFilter.NextFilter nextFilter)
Performs the handshake process.- Parameters:
nextFilter
- the next filter
-
messageReceived
public void messageReceived(IoFilter.NextFilter nextFilter, IoBuffer buf)
Handles 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 buffered data received
-
handleResponse
protected void handleResponse(IoFilter.NextFilter nextFilter, IoBuffer buf, int step) throws Exception
Handle a SOCKS v5 response from the proxy server.- Parameters:
nextFilter
- the next filterbuf
- the buffered data receivedstep
- the current step in the authentication process- Throws:
Exception
- If something went wrong
-
closeSession
protected void closeSession(String message)
Closes the session. If anyGSSContext
is present in the session then it is closed.- Overrides:
closeSession
in classAbstractProxyLogicHandler
- Parameters:
message
- the error message
-
-