Package net.i2p.i2ptunnel
Class I2PTunnelIRCServer
- java.lang.Object
-
- net.i2p.util.EventDispatcherImpl
-
- net.i2p.i2ptunnel.I2PTunnelTask
-
- net.i2p.i2ptunnel.I2PTunnelServer
-
- net.i2p.i2ptunnel.I2PTunnelIRCServer
-
- All Implemented Interfaces:
Runnable
,EventDispatcher
public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable
Simple extension to the I2PTunnelServer that filters the registration sequence to pass the destination hash of the client through as the hostname, so an IRC Server may track users across nick changes. Of course, this requires the ircd actually use the hostname sent by the client rather than the IP. It is common for ircds to ignore the hostname in the USER message (unless it's coming from another server) since it is easily spoofed. So you have to fix or, if you are lucky, configure your ircd first. At least in unrealircd and ngircd this is not configurable. There are three options for mangling the desthash. Put the option in the "custom options" section of i2ptunnel. - ircserver.method unset: Defaults to user. - ircserver.method=user: Use method described above. - ircserver.method=webirc: Use the WEBIRC protocol. - ircserver.cloakKey unset: Cloak with a random value that is persistent for the life of this tunnel. This is the default. - ircserver.cloakKey=somepassphrase: Cloak with the hash of the passphrase. Use this to have consistent mangling across restarts, or to have multiple IRC servers cloak consistently to be able to track users even when they switch servers. Note: don't quote or put spaces in the passphrase, the i2ptunnel gui can't handle it. - ircserver.webircPassword=password The password to use for the WEBIRC protocol. - ircserver.webircSpoofIP=IP The IP - ircserver.fakeHostname=%f.b32.i2p: Set the fake hostname sent by I2PTunnel, %f is the full B32 destination hash %c is the cloaked hash. There is no outbound filtering.- Author:
- zzz
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROP_CLOAK
static String
PROP_HOSTNAME
static String
PROP_HOSTNAME_DEFAULT
static String
PROP_METHOD
static String
PROP_METHOD_DEFAULT
static String
PROP_WEBIRC_PASSWORD
static String
PROP_WEBIRC_SPOOF_IP
static String
PROP_WEBIRC_SPOOF_IP_DEFAULT
-
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelServer
__serverId, _clientExecutor, _log, bidir, i2pss, l, localPort, PROP_ALT_PKF, PROP_UNIQUE_LOCAL, PROP_USE_SSL, readTimeout, remoteHost, remotePort, slock, sockMgr, sslLock, task
-
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelTask
open
-
-
Constructor Summary
Constructors Constructor Description I2PTunnelIRCServer(InetAddress host, int port, File privkey, String privkeyname, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
blockingHandle(I2PSocket socket)
This is run in a thread from a limited-size thread pool via Handler.run(), except for a standard server (this class, no extension, as determined in getUsePool()), it is run directly in the acceptor thread (see run()).-
Methods inherited from class net.i2p.i2ptunnel.I2PTunnelServer
close, destroy, getHandlerCount, getReadTimeout, getSocket, getSocket, optionsUpdated, run, setReadTimeout, shouldUsePool, startRunning
-
Methods inherited from class net.i2p.i2ptunnel.I2PTunnelTask
connected, disconnected, errorOccurred, getId, getTunnel, isOpen, reportAbuse, routerDisconnected, setId, setName, setTunnel, toString
-
Methods inherited from class net.i2p.util.EventDispatcherImpl
attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValue
-
-
-
-
Field Detail
-
PROP_METHOD
public static final String PROP_METHOD
- See Also:
- Constant Field Values
-
PROP_METHOD_DEFAULT
public static final String PROP_METHOD_DEFAULT
- See Also:
- Constant Field Values
-
PROP_CLOAK
public static final String PROP_CLOAK
- See Also:
- Constant Field Values
-
PROP_WEBIRC_PASSWORD
public static final String PROP_WEBIRC_PASSWORD
- See Also:
- Constant Field Values
-
PROP_WEBIRC_SPOOF_IP
public static final String PROP_WEBIRC_SPOOF_IP
- See Also:
- Constant Field Values
-
PROP_WEBIRC_SPOOF_IP_DEFAULT
public static final String PROP_WEBIRC_SPOOF_IP_DEFAULT
- See Also:
- Constant Field Values
-
PROP_HOSTNAME
public static final String PROP_HOSTNAME
- See Also:
- Constant Field Values
-
PROP_HOSTNAME_DEFAULT
public static final String PROP_HOSTNAME_DEFAULT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
I2PTunnelIRCServer
public I2PTunnelIRCServer(InetAddress host, int port, File privkey, String privkeyname, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
- Throws:
IllegalArgumentException
- if the I2PTunnel does not contain valid config to contact the router
-
-
Method Detail
-
blockingHandle
protected void blockingHandle(I2PSocket socket)
Description copied from class:I2PTunnelServer
This is run in a thread from a limited-size thread pool via Handler.run(), except for a standard server (this class, no extension, as determined in getUsePool()), it is run directly in the acceptor thread (see run()). In either case, this method and any overrides must spawn a thread and return quickly. If blocking while reading the headers (as in HTTP and IRC), the thread pool may be exhausted. See PROP_USE_POOL, DEFAULT_USE_POOL, PROP_HANDLER_COUNT, DEFAULT_HANDLER_COUNT- Overrides:
blockingHandle
in classI2PTunnelServer
-
-