Raw port

A TCP tunnel is for connections that have no HTTP headers. A database, a custom protocol, or another raw endpoint gets an address this way.

Open the tunnel

tunl tcp 5432

The local endpoint is 127.0.0.1:5432. For another host, pass --host or write the address directly: tunl tcp 10.0.0.8:5432.

Public address

The server picks a free port from 19000–19040 on 127.0.0.1. A tunnel with no name does not sit on the fixed port of a reserved name; that port is skipped even when it is free. If the range has no free port left, the server says boş tcp portu yok. The address in the output, in the form tcp://127.0.0.1:19000, is the raw connection to the local port. The range is changed with aditd --tcp-bind, --tcp-min, and --tcp-max. --tcp-min 0 asks for an ephemeral port. In that case --tcp-max is not used. The default bind is 127.0.0.1: to reach it from another machine, pass --tcp-bind 0.0.0.0. A raw port does not ask for a password; limit which addresses may connect with --allow. In Docker this bind is already set in the image; only add -p 19000-19040:19000-19040.

TLS passthrough (SNI & dedicated port)

tunl tls 4430 --name secure

The TLS session at the local endpoint is not terminated on the server. Encrypted bytes pass straight through so clients see your local service's own certificate. When the server's HTTPS listener is enabled, aditd peeks the TLS ClientHello SNI extension and routes connections for secure.<domain> on the shared HTTPS port (443 or 8443) directly to your tunnel with zero TLS termination. A dedicated port in the 19000–19040 range (tls://127.0.0.1:19000) is also opened for compatibility. In tunl.yml, write proto: tls.

Record and a fixed port

A TCP or TLS line is recorded by the inspector too. If an edge rule does not match, the connection closes and is recorded the same way. A header rule stops the command on these tunnels by saying üstbilgi yalnız http. A tunnel that was given a name sits on the same port again. If that port is busy, the server says ayrılmış port N dolu, leaves the saved port where it is, and the agent tries again.

From a file

tunnels:
  sql:
    proto: tcp
    addr: 5432

To open them together, see the multiple tunnels page.