{% extends "global/layout.html" %} {% block title %}I2PTunnel{% endblock %} {% block lastupdated %}2023-10{% endblock %} {% block accuratefor %}0.9.59{% endblock %} {% block content %}

{% trans %}Overview{% endtrans %}

{% trans naming=site_url('docs/naming') -%} I2PTunnel is a tool for interfacing with and providing services on I2P. Destination of an I2PTunnel can be defined using a hostname, Base32, or a full 516-byte destination key. An established I2PTunnel will be available on your client machine as localhost:port. If you wish to provide a service on I2P network, you simply create I2PTunnel to the appropriate ip_address:port. A corresponding 516-byte destination key will be generated for the service and it will become avaliable throughout I2P. A web interface for I2PTunnel management is avaliable on localhost:7657/i2ptunnel/. {%- endtrans %}

{% trans %}Default Services{% endtrans %}

{% trans %}Server tunnels{% endtrans %}

{% trans %}Client tunnels{% endtrans %}

{% trans %}Configuration{% endtrans %}

{{ _('I2PTunnel Configuration') }}

{% trans %}Client Modes{% endtrans %}

{% trans %}Standard{% endtrans %}

{% trans -%} Opens a local TCP port that connects to a service (like HTTP, FTP or SMTP) on a destination inside of I2P. The tunnel is directed to a random host from the comma seperated (", ") list of destinations. {%- endtrans %}

HTTP

{% trans -%} A HTTP-client tunnel. The tunnel connects to the destination specified by the URL in a HTTP request. Supports proxying onto internet if an outproxy is provided. Strips HTTP connections of the following headers: {%- endtrans %}

The HTTP client proxy provides a number of services to protect the user and to provide a better user experience.

Transparent Response Compression

The i2ptunnel response compression is requested with the HTTP header:

The server side strips this hop-by-hop header before sending the request to the web server. The elaborate header with all the q values is not necessary; servers should just look for "x-i2p-gzip" anywhere in the header.

The server side determines whether to compress the response based on the headers received from the webserver, including Content-Type, Content-Length, and Content-Encoding, to assess if the response is compressible and is worth the additional CPU required. If the server side compresses the response, it adds the following HTTP header:

If this header is present in the response, the HTTP client proxy transparently decompresses it. The client side strips this header and gunzips before sending the response to the browser. Note that we still have the underlying gzip compression at the I2CP layer, which is still effective if the response is not compressed at the HTTP layer.

This design and the current implementation violate RFC 2616 in several ways:

Changes to implement a standards-compliant hop-by-hop compression in a backward-compatible manner are a topic for further study. Any change to dechunk-gzip-rechunk would require a new encoding type, perhaps x-i2p-gzchunked. This would be identical to Transfer-Encoding: gzip, but would have to be signalled differently for compatibility reasons. Any change would require a formal proposal.

Transparent Request Compression

Not supported, although POST would benefit. Note that we still have the underlying gzip compression at the I2CP layer.

Persistence

The client and server proxies do not currently support RFC 2616 HTTP persistent sockets on any of the three hops (browser socket, I2P socket, server socket). Connection: close headers are injected at every hop. Changes to implement a persistence are under investigation. These changes should be standards-complaint and backwards-compatible, and would not require a formal proposal.

Pipelining

The client and server proxies do not currently support RFC 2616 HTTP pipelining and there are no plans to do so. Modern browswers do not support pipelining through proxies because most proxies cannot implement it correctly.

Compatibility

Proxy implementations must work correctly with other implementations on the other side. Client proxies should work without a HTTP-aware server proxy (i.e. a standard tunnel) on the server side. Not all implementations support x-i2p-gzip.

User Agent

{% trans -%} Depending on if the tunnel is using an outproxy or not it will append the following User-Agent: {%- endtrans %}

IRC Client

{% trans -%} Creates a connection to a random IRC server specified by the comma seprated (", ") list of destinations. Only a whitelisted subset of IRC commands are allowed due to anonymity concerns. {%- endtrans %} The following allow list is for commands inbound from the IRC server to the IRC client.
Allow list:

There is also an allow list is for commands outbound from the IRC client to the IRC server. It is quite large due to the number of IRC administrative commands. See the IRCFilter.java source for details. The outbound filter also modifies the following commands to strip identifying information:

SOCKS 4/4a/5

{% trans -%} Enables using the I2P router as a SOCKS proxy. {%- endtrans %}

SOCKS IRC

{% trans -%} Enables using the I2P router as a SOCKS proxy with the command whitelist specified by IRC client mode. {%- endtrans %}

CONNECT

{% trans -%} Creates a HTTP tunnel and uses the HTTP request method "CONNECT" to build a TCP tunnel that usually is used for SSL and HTTPS. {%- endtrans %}

Streamr

{% trans -%} Creates a UDP-server attached to a Streamr client I2PTunnel. The streamr client tunnel will subscribe to a streamr server tunnel. {%- endtrans %}


{% trans %}Server Modes{% endtrans %}

{% trans %}Standard{% endtrans %}

{% trans -%} Creates a destination to a local ip:port with an open TCP port. {%- endtrans %}

HTTP

{% trans -%} Creates a destination to a local HTTP server ip:port. Supports gzip for requests with Accept-encoding: x-i2p-gzip, replies with Content-encoding: x-i2p-gzip in such a request. {%- endtrans %}

The HTTP server proxy provides a number of services to make hosting a website easier and more secure, and to provide a better user experience on the client side.

HTTP Bidirectional

Deprecated

{% trans -%} Functions as both a I2PTunnel HTTP Server, and a I2PTunnel HTTP client with no outproxying capabilities. An example application would be a web application that does client-type requests, or loopback-testing an I2P Site as a diagnostic tool. {%- endtrans %}

IRC Server

{% trans -%} Creates a destination that filters the reqistration sequence of a client and passes the clients destination key as a hostname to the IRC-server. {%- endtrans %}

Streamr

{% trans -%} A UDP-client that connects to a media server is created. The UDP-Client is coupled with a Streamr server I2PTunnel. {%- endtrans %}

{% endblock %}