## net.i2p.i2ptunnel
Class I2PTunnelIRCServer

    java.lang.Object
      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
`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, _log, bidir, i2pss, localPort, readTimeout, remoteHost, remotePort, slock, sockMgr, task`

Fields inherited from class net.i2p.i2ptunnel.I2PTunnelTask
`open`

Constructor Summary
`I2PTunnelIRCServer(InetAddress host, int port, File privkey, String privkeyname, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)`

Method Summary
`protected void` `blockingHandle(I2PSocket socket)`
`(package private) String` `cloakDest(Destination d)` (Optionally) append 32 bytes of crap to the destination then return the first few characters of the hash of the whole thing, + ".i2p".

Methods inherited from class net.i2p.i2ptunnel.I2PTunnelServer
`close, getHandlerCount, getReadTimeout, run, setReadTimeout, shouldUsePool, startRunning`

Methods inherited from class net.i2p.i2ptunnel.I2PTunnelTask
`attachEventDispatcher, detachEventDispatcher, disconnected, errorOccurred, getEventDispatcher, getEvents, getEventValue, getId, getTunnel, ignoreEvents, isOpen, notifyEvent, reportAbuse, routerDisconnected, setId, setName, setTunnel, toString, unIgnoreEvents, waitEventValue`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.lang.Runnable
`run`

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)

  Overrides:
    `blockingHandle` in class `I2PTunnelServer`

### cloakDest

    String cloakDest(Destination d)

  (Optionally) append 32 bytes of crap to the destination then return the first few characters of the hash of the whole thing, + ".i2p". Or do we want the full hash if the ircd is going to use this for nickserv auto-login? Or even Base32 if it will be used in a case-insensitive manner?