public class I2PSOCKSTunnel extends I2PTunnelClientBase
This class implements a SOCKS4a/5 proxy server that accepts local SOCKS connections and forwards them to I2P destinations or configured outproxies. It supports both I2P destination routing (for .i2p addresses) and outproxy routing for clearnet access, with authentication and port-specific proxy configuration.
The tunnel provides dynamic destination resolution, connection management, and serves as a flexible proxy solution for applications that support SOCKS protocol, enabling seamless I2P integration for various clients.
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_REALM |
static String |
DEFAULT |
protected static int |
INITIAL_SO_TIMEOUT
This is a standard soTimeout, not a total timeout.
|
static String |
PROP_OUTPROXY_TYPE |
static String |
PROP_PROXY_DEFAULT |
static String |
PROP_PROXY_PREFIX
add "default" or port number
|
_clientId, _context, _log, _ownDest, dest, l, listenerReady, mySockets, PROP_USE_SSL, sockLock, sockMgr, ssopen, tunnel| Constructor and Description |
|---|
I2PSOCKSTunnel(int localPort,
Logging l,
boolean ownDest,
EventDispatcher notifyThis,
I2PTunnel tunnel,
String pkf)
As of 0.9.20 this is fast, and does NOT connect the manager to the router,
or open the local socket.
|
| Modifier and Type | Method and Description |
|---|---|
I2PSocketOptions |
buildOptions(Properties overrides)
Because getDefaultOptions() in super() is protected
|
protected void |
clientConnectionRun(Socket s)
Manage a connection in a separate thread.
|
List<String> |
getDefaultProxies() |
List<String> |
getProxies(int port)
Gets the proxy list for a specific port.
|
HashMap<String,List<String>> |
getProxyMap()
Gets the proxy map for all configured ports.
|
void |
optionsUpdated(I2PTunnel tunnel)
Update the outproxy list then call super.
|
buildSocketManager, buildSocketManager, buildSocketManager, buildSocketManager, close, closeSocket, createI2PSocket, createI2PSocket, createI2PSocket, destroy, getDefaultOptions, getDefaultOptions, getListenHost, getLocalPort, getSocketManager, getSocketManager, getSocketManager, killSharedClient, manageConnection, run, startRunning, verifySocketManagerconnected, disconnected, errorOccurred, getBooleanOption, getId, getTunnel, isOpen, reportAbuse, routerDisconnected, setId, setName, setTunnel, toStringattachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValuepublic static final String AUTH_REALM
public static final String DEFAULT
protected static final int INITIAL_SO_TIMEOUT
public static final String PROP_OUTPROXY_TYPE
public static final String PROP_PROXY_DEFAULT
public static final String PROP_PROXY_PREFIX
public I2PSOCKSTunnel(int localPort,
Logging l,
boolean ownDest,
EventDispatcher notifyThis,
I2PTunnel tunnel,
String pkf)
pkf - private key file name or null for transient keypublic I2PSocketOptions buildOptions(Properties overrides)
protected void clientConnectionRun(Socket s)
I2PTunnelClientBaseclientConnectionRun in class I2PTunnelClientBasepublic List<String> getProxies(int port)
If no proxies are configured for the port, returns the default proxies.
port - the local port to get proxies forpublic HashMap<String,List<String>> getProxyMap()
public void optionsUpdated(I2PTunnel tunnel)
optionsUpdated in class I2PTunnelClientBase