net.i2p.i2ptunnel
Class I2PTunnelHTTPServer

java.lang.Object
  extended by net.i2p.util.EventDispatcherImpl
      extended by net.i2p.i2ptunnel.I2PTunnelTask
          extended by net.i2p.i2ptunnel.I2PTunnelServer
              extended by net.i2p.i2ptunnel.I2PTunnelHTTPServer
All Implemented Interfaces:
Runnable, EventDispatcher
Direct Known Subclasses:
I2PTunnelHTTPBidirServer

public class I2PTunnelHTTPServer
extends I2PTunnelServer

Simple extension to the I2PTunnelServer that filters the HTTP headers sent from the client to the server, replacing the Host header with whatever this instance has been configured with, and if the browser set Accept-encoding: x-i2p-gzip, gzip the http message body and set Content-encoding: x-i2p-gzip.


Field Summary
 
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelServer
__serverId, _log, bidir, i2pss, l, localPort, readTimeout, remoteHost, remotePort, slock, sockMgr, task
 
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelTask
open
 
Constructor Summary
I2PTunnelHTTPServer(InetAddress host, int port, File privkey, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
           
I2PTunnelHTTPServer(InetAddress host, int port, InputStream privData, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
           
I2PTunnelHTTPServer(InetAddress host, int port, String privData, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
           
 
Method Summary
protected  void blockingHandle(I2PSocket socket)
          Called by the thread pool of I2PSocket handlers
protected static String formatHeaders(Map<String,List<String>> headers, StringBuilder command)
           
protected static Map<String,List<String>> readHeaders(InputStream in, StringBuilder command, String[] skipHeaders, I2PAppContext ctx)
           
 void startRunning()
          Start running the I2PTunnelServer.
 
Methods inherited from class net.i2p.i2ptunnel.I2PTunnelServer
close, getHandlerCount, getReadTimeout, optionsUpdated, run, setReadTimeout, shouldUsePool
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

I2PTunnelHTTPServer

public I2PTunnelHTTPServer(InetAddress host,
                           int port,
                           String privData,
                           String spoofHost,
                           Logging l,
                           EventDispatcher notifyThis,
                           I2PTunnel tunnel)

I2PTunnelHTTPServer

public I2PTunnelHTTPServer(InetAddress host,
                           int port,
                           File privkey,
                           String privkeyname,
                           String spoofHost,
                           Logging l,
                           EventDispatcher notifyThis,
                           I2PTunnel tunnel)

I2PTunnelHTTPServer

public I2PTunnelHTTPServer(InetAddress host,
                           int port,
                           InputStream privData,
                           String privkeyname,
                           String spoofHost,
                           Logging l,
                           EventDispatcher notifyThis,
                           I2PTunnel tunnel)
Method Detail

startRunning

public void startRunning()
Description copied from class: I2PTunnelServer
Start running the I2PTunnelServer. TODO: Wait to connect to router until here.

Overrides:
startRunning in class I2PTunnelServer

blockingHandle

protected void blockingHandle(I2PSocket socket)
Called by the thread pool of I2PSocket handlers

Overrides:
blockingHandle in class I2PTunnelServer

formatHeaders

protected static String formatHeaders(Map<String,List<String>> headers,
                                      StringBuilder command)

readHeaders

protected static Map<String,List<String>> readHeaders(InputStream in,
                                                      StringBuilder command,
                                                      String[] skipHeaders,
                                                      I2PAppContext ctx)
                                               throws IOException
Throws:
IOException