Package net.i2p.i2ptunnel.socks
Class SOCKSServer
java.lang.Object
net.i2p.i2ptunnel.socks.SOCKSServer
- Direct Known Subclasses:
SOCKS4aServer
,SOCKS5Server
Abstract base class used by all SOCKS servers.
- Author:
- human
-
Field Summary
Modifier and TypeFieldDescriptionprotected final I2PAppContext
protected final Log
protected int
protected final Socket
protected String
protected int
protected final Properties
-
Constructor Summary
ModifierConstructorDescriptionprotected
SOCKSServer
(I2PAppContext ctx, Socket clientSock, Properties props) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Confirm to the client that the connection has succeededabstract Socket
Get a socket that can be used to send/receive 8-bit clean data to/from the client.abstract I2PSocket
Get an I2PSocket that can be used to send/receive 8-bit clean data to/from the destination of the SOCKS connection.protected String
IP to domain name mapping support.protected Outproxy
protected abstract void
Perform server initialization (expecially regarding protected variables).
-
Field Details
-
connHostName
-
connPort
protected int connPort -
addressType
protected int addressType -
_context
-
clientSock
-
props
-
_log
-
-
Constructor Details
-
SOCKSServer
- Since:
- 0.9.27
-
-
Method Details
-
getMappedDomainNameForIP
IP to domain name mapping support. This matches the given IP string against a user-set list of mappings. This enables applications which do not properly support the SOCKS5 DOMAINNAME feature to be used with I2P.- Parameters:
ip
- The IP address to check.- Returns:
- The domain name if a mapping is found, or null otherwise.
- Since:
- 0.9.5
-
setupServer
Perform server initialization (expecially regarding protected variables).- Throws:
SOCKSException
-
getClientSocket
Get a socket that can be used to send/receive 8-bit clean data to/from the client.- Returns:
- a Socket connected with the client
- Throws:
SOCKSException
-
confirmConnection
Confirm to the client that the connection has succeeded- Throws:
SOCKSException
-
getDestinationI2PSocket
Get an I2PSocket that can be used to send/receive 8-bit clean data to/from the destination of the SOCKS connection.- Returns:
- an I2PSocket connected with the destination
- Throws:
SOCKSException
-
getOutproxyPlugin
- Returns:
- null if disabled or not installed
- Since:
- 0.9.27
-