All Implemented Interfaces:
Runnable, EventDispatcher

public class I2PTunnelHTTPBidirServerextends I2PTunnelHTTPServer
Bidirectional HTTP server tunnel combining server and client functionality.

Extends I2PTunnelHTTPServer to provide both inbound and outbound HTTP connectivity through I2P. Creates a server tunnel for receiving requests and a client tunnel (proxy) for outbound requests, enabling bidirectional HTTP communication through a single I2P destination.

This class manages two tunnel components:

  • Server: Incoming HTTP connections via I2PServerSocket
  • Client: I2PTunnelHTTPBidirProxy for outbound HTTP requests

Useful for applications requiring both server and client HTTP capabilities through I2P, such as web applications making external API calls.

See Also:
  • Constructor Details

    • I2PTunnelHTTPBidirServer

      public I2PTunnelHTTPBidirServer(InetAddress host, int port, int proxyport, String privData, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
      Creates a bidirectional HTTP server tunnel.

      The server listens for incoming HTTP connections on the specified port, while the client proxy handles outbound requests through a separate port.

      Parameters:
      host - the local InetAddress to bind the server to (usually null/0.0.0.0)
      port - the local port for incoming HTTP server connections
      proxyport - the local port for the outbound HTTP proxy
      privData - Base64-encoded private key data for the I2P destination
      spoofHost - the spoofed hostname for the server destination
      l - the Logging instance for status messages
      notifyThis - the EventDispatcher for tunnel events
      tunnel - the parent I2PTunnel instance
      Throws:
      IllegalArgumentException - if the I2CP configuration is invalid
    • I2PTunnelHTTPBidirServer

      public I2PTunnelHTTPBidirServer(InetAddress host, int port, int proxyport, File privkey, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
      Creates a bidirectional HTTP server tunnel with a private key file.
      Parameters:
      host - the local InetAddress to bind the server to
      port - the local port for incoming HTTP server connections
      proxyport - the local port for the outbound HTTP proxy
      privkey - File containing Base64-encoded private key data
      privkeyname - the name of the private key file (for logging)
      spoofHost - the spoofed hostname for the server destination
      l - the Logging instance for status messages
      notifyThis - the EventDispatcher for tunnel events
      tunnel - the parent I2PTunnel instance
      Throws:
      IllegalArgumentException - if the key file cannot be read
    • I2PTunnelHTTPBidirServer

      public I2PTunnelHTTPBidirServer(InetAddress host, int port, int proxyport, InputStream privData, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
      Creates a bidirectional HTTP server tunnel with an input stream for the private key.
      Parameters:
      host - the local InetAddress to bind the server to
      port - the local port for incoming HTTP server connections
      proxyport - the local port for the outbound HTTP proxy
      privData - InputStream containing Base64-encoded private key data
      privkeyname - the name of the private key (for logging)
      spoofHost - the spoofed hostname for the server destination
      l - the Logging instance for status messages
      notifyThis - the EventDispatcher for tunnel events
      tunnel - the parent I2PTunnel instance
      Throws:
      IllegalArgumentException - if the key data is invalid
  • Method Details

    • finishSetupI2PTunnelHTTPBidirServer

      private void finishSetupI2PTunnelHTTPBidirServer(Logging l, int proxyport)
      Completes the bidirectional server setup by initializing the client proxy.

      This method is called after the parent server tunnel is initialized. It creates the outbound HTTP proxy component and starts both tunnels.

      Parameters:
      l - the Logging instance
      proxyport - the port for the outbound HTTP proxy