abstract class SOCKSServer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected I2PAppContext | _context |
protected Log | _log |
protected int | addressTypeSOCKS address type (e.g. |
protected Socket | clientSock |
protected String | connHostNameHostname requested by the SOCKS client. |
protected int | connPortPort requested by the SOCKS client. |
protected Properties | props |
| Modifier | Constructor and Description |
|---|---|
protected | SOCKSServer(I2PAppContext ctx,
Socket clientSock,
Properties props) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void | confirmConnection()Confirm to the client that the connection has succeeded |
abstract Socket | getClientSocket()Get a socket that can be used to send/receive 8-bit clean data
to/from the client. |
abstract 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 String | getMappedDomainNameForIP(String ip)IP to domain name mapping support. |
protected Outproxy | getOutproxyPlugin() |
void | httpsConnect(I2PSocket destSock,
OutputStream pout,
String connHostName,
int connPort,
String configUser,
String configPW)Act as a https client to connect to a CONNECT outproxy. |
protected I2PSocket | outproxyConnect(I2PSOCKSTunnel tun,
String proxy)Act as a SOCKS 5 client to connect to an outproxy
Caller must send success or error to local socks client. |
protected abstract void | setupServer()Perform server initialization (expecially regarding protected
variables). |
protected final I2PAppContext _context
protected final Log _log
protected int addressType
protected final Socket clientSock
protected String connHostName
protected int connPort
protected final Properties props
protected SOCKSServer(I2PAppContext ctx, Socket clientSock, Properties props)
protected abstract void confirmConnection()
throws SOCKSExceptionSOCKSExceptionpublic abstract Socket getClientSocket() throws SOCKSException
SOCKSExceptionpublic abstract I2PSocket getDestinationI2PSocket(I2PSOCKSTunnel t) throws SOCKSException
SOCKSExceptionprotected String getMappedDomainNameForIP(String ip)
ip - The IP address to check.protected Outproxy getOutproxyPlugin()
public void httpsConnect(I2PSocket destSock, OutputStream pout, String connHostName, int connPort, String configUser, String configPW) throws IOException
destSock - socket to the proxypout - output stream to the proxyconnHostName - hostname or IP for the proxy to connect toconnPort - port for the proxy to connect toconfigUser - username unsupportedconfigPW - password unsupportedIOExceptionprotected I2PSocket outproxyConnect(I2PSOCKSTunnel tun, String proxy) throws IOException, I2PException
IOExceptionI2PExceptionprotected abstract void setupServer()
throws SOCKSExceptionSOCKSException