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
Socks4LogicHandler.java - SOCKS4/SOCKS4a authentication mechanisms logic handler.
- Since:
- MINA 2.0.0-M3
-
Field Summary
FieldsFields inherited from class AbstractSocksLogicHandler
request -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoHandshake(IoFilter.NextFilter nextFilter) Perform the handshake.protected voidhandleResponse(IoBuffer buf) Handle a SOCKS4/SOCKS4a response from the proxy server.voidmessageReceived(IoFilter.NextFilter nextFilter, IoBuffer buf) Handle incoming data during the handshake process.protected voidwriteRequest(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 AbstractProxyLogicHandler
closeSession, closeSession, enqueueWriteRequest, flushPendingWriteRequests, getProxyFilter, getProxyIoSession, getSession, isHandshakeComplete, setHandshakeComplete, writeData
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
Socks4LogicHandler
- Parameters:
proxyIoSession- The original session- See Also:
-
-
Method Details
-
doHandshake
Perform the handshake.- Parameters:
nextFilter- the next filter
-
writeRequest
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
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
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.
-