class SOCKS4aServer extends SOCKSServer
This class processes SOCKS4a protocol requests, supporting both IPv4 addresses and domain name resolution (the "4a" extension). It validates requests, maps IP addresses to domain names when configured, and forwards connections to I2P destinations or outproxies.
Handles CONNECT commands, rejects unsupported BIND commands, and provides proper error responses. The server integrates with I2P naming service for destination resolution and supports security restrictions on localhost access.
_context, _log, addressType, clientSock, connHostName, connPort, props| Constructor and Description |
|---|
SOCKS4aServer(I2PAppContext ctx,
Socket clientSock,
Properties props)
Create a SOCKS4a server that communicates with the client using
the specified socket.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
confirmConnection()
Confirm to the client that the connection has succeeded
|
Socket |
getClientSocket()
Get a socket that can be used to send/receive 8-bit clean data
to/from the client.
|
I2PSocket |
getDestinationI2PSocket(I2PSOCKSTunnel t)
Get an I2PSocket that can be used to send/receive 8-bit clean data
to/from the destination of the SOCKS connection.
|
protected void |
setupServer()
Perform server initialization (expecially regarding protected
variables).
|
getMappedDomainNameForIP, getOutproxyPluginpublic SOCKS4aServer(I2PAppContext ctx, Socket clientSock, Properties props)
clientSock - client socketprops - non-nullprotected void confirmConnection()
throws SOCKSException
SOCKSServerconfirmConnection in class SOCKSServerSOCKSExceptionpublic Socket getClientSocket() throws SOCKSException
SOCKSServergetClientSocket in class SOCKSServerSOCKSExceptionpublic I2PSocket getDestinationI2PSocket(I2PSOCKSTunnel t) throws SOCKSException
getDestinationI2PSocket in class SOCKSServerSOCKSExceptionprotected void setupServer()
throws SOCKSException
SOCKSServersetupServer in class SOCKSServerSOCKSException