package net.i2p.i2ptunnel
Implementation of preconfigured tunnels for clients and servers, including special-purpose tunnels for IRC, SOCKS, HTTP and streaming.
The entry point is TunnelControllerGroup, started from clients.config; tunnel configuration is stored in i2ptunnel.config. The primary API consists of TunnelControllerGroup and TunnelController; other classes may not be maintained as a stable API.
- Client tunnels: let external applications connect out to I2P destinations
- Server tunnels: expose local services to the I2P network
- HTTP proxy and server tunnels: browser-friendly web access
- SOCKS tunnels: generic SOCKS proxy for TCP applications
- IRC tunnels: DCC and CTCP handling for IRC clients
- StreamR tunnels: adaptive-rate streaming
- UDP tunnels: datagram bridging for DNS and voice
The web interface for creating and editing tunnels is in net.i2p.i2ptunnel.web.
See also: RFC 3986 (URI generic syntax) • RFC 7230 (HTTP/1.1 message syntax).
- ClassDescriptionSimple blacklist checker for HTTP proxy.Manages HTTP blocklists for request filtering.Connection rate limiter providing basic DoS protection.Keep a list of seen times, and a ban-until time.Utility class for formatting HTTP headers.HTTP response stream with transparent gzip decompression (client side).I2P ping utility for CLI use.The outcome of one ping.Manages I2PTunnelTasks and I2PSessions.How the tunnel is closed by the console or command line.Callback routine to find out.Standard I2P client tunnel that forwards local TCP connections to I2P destinations.Abstract base class for I2P client tunnels with common functionality.The state of the shared socket manager.SSL tunnel through HTTP proxy using CONNECT method.HTTP proxy reusing server's I2PSocketManager without outproxy capability.Bidirectional HTTP server tunnel combining server and client functionality.HTTP proxy that tunnels requests through I2P.Read the first line unbuffered, then subsequent lines.Request-scoped state machine for one speculative warm socket.Slot lifecycle.Common things for HTTPClient and ConnectClient Retrofit over them in 0.8.2.Authentication result status for HTTP client connections.Tracks nonce values for digest authentication.HTTP client runner that filters response headers to enforce the "Connection: close" header, ensuring browsers treat the connection as non-persistent, even if the server doesn't comply.HTTP server tunnel that filters headers and provides compression.Thrown when HTTP headers are malformed.Watchdog for an async (detached) body handoff.Copies a gzipped request through to the web server.Gzips the response on its way to the browser.Thrown when a header line exceeds MAX_LINE_LENGTH, when there are too many headers, or when total header size exceeds MAX_TOTAL_HEADER_SIZE.Thrown when the request line exceeds MAX_LINE_LENGTH.Pumps a client request body through to the I2P side and back.IRC client tunnel with DCC support and filtering.IRC server tunnel that filters registration to pass client destination hash as hostname.Thrown when a client's registration sequence is unacceptable and the connection is dropped.I2PTunnelOutproxyRunner forwards data bidirectionally between two connected sockets: one representing an external socket connection and the other an I2P socket connection.Thread that forwards traffic between an I2PSocket and a TCP Socket.Snapshot of body-delivery progress used by
I2PTunnelRunner.shouldResumeIncompleteBody(long, long, boolean, boolean, boolean).For use in new constructor.Winner of a dual-race empty retry: the socket that produced the first response byte, with a pushback stream that still holds that byte so the forwarder never loses the head of the response.Callback for reconnecting via a second route when the first attempt completes with zero upstream bytes, or dies mid-body with an incomplete Content-Length response (Range resume).Progress-based budget for body-resume cycles.Callback interface for successful tunnel operation completion.Base I2P tunnel server for handling incoming connections.Base class for I2P tunnel servers and clients.Listens for in-JVM connections on internal socket.Unified logging interface for I2PTunnel components.Utility class for MIME type detection based on URL file extensions.Validates HTTP requests for security and policy compliance.Encapsulates the result of hostname validation.Builds and manages HTTP security headers for server responses.SSL server socket utilities for I2PTunnel clients.Coordinate the runtime operation and configuration of a single I2PTunnel.The tunnel state.Coordinates tunnel groups within the JVM, managing configuration persistence.Thread factory that sets daemon flag and names threads.Thread pool executor for I2P tunnel client handlers.Per-tunnel runner pool state: the explicit per-tunnel ceiling and the lazily created executor.Per-tunnel server-handler pool state: the explicit per-tunnel cap (or -1 for the Tuner-managed default) and the lazily created executor.