tunnelctl
Concepts

Tunnels & protocols

The tunnel model — HTTP slugs, TCP/UDP remote ports, public addresses, and lifecycle state.

A tunnel is a reservation that maps a public endpoint to a local service. Every tunnel has a protocolhttp, tcp, or udp — chosen when you start it (up http|tcp|udp). The protocol decides how the tunnel is addressed and how its public endpoint is rendered.

HTTP tunnels — addressed by slug

An HTTP tunnel is identified by a globally-unique slug, which becomes the subdomain of its public URL: slug myapphttps://myapp.intunnel.eu. Slugs are DNS-safe:

  • 3–32 characters
  • lowercase letters, digits, and hyphens (a-z, 0-9, -)
  • must start and end with a letter or digit

Check availability before reserving with slugs check.

TCP / UDP tunnels — addressed by remote port

L4 tunnels (raw TCP and UDP) don't use a slug. Instead you pick a remote port from the server's shared pool, and the tunnel is exposed on the apex:

  • TCP → tcp.intunnel.eu:<remote-port>
  • UDP → udp.intunnel.eu:<remote-port>
tunnelctl up tcp 27017 5432    # tcp.intunnel.eu:27017 → 127.0.0.1:5432
tunnelctl up udp 5353 53       # udp.intunnel.eu:5353 → 127.0.0.1:53

The port must be inside the allowed range and free — use ports to see the range (ports range), test a port (ports check), or grab a free one (ports pick). Internally the server names an L4 tunnel tcp-<port> / udp-<port>; you only ever work with the port number.

HTTP vs L4 addressing, at a glance

HTTP = one shared :443 edge, routed by hostname (<slug>.intunnel.eu). TCP/UDP = a dedicated public port on the apex (tcp.intunnel.eu:<port>). That's why HTTP needs a unique slug and L4 needs a free port.

What a tunnel holds

FieldMeaning
protocolhttp, tcp, or udp
slug / remotePortpublic subdomain (HTTP) or public port (TCP/UDP)
ownerthe SSO subject + email of the creator
targetPortthe local port traffic is forwarded to
enabledwhether the tunnel accepts connections
statelifecycle state (below)
connection token serialmonotonic counter used to invalidate old sessions

Lifecycle state

A tunnel moves through a small state machine on the server:

StateMeaning
ReservedCreated, but no client has connected yet (short TTL).
ActiveA client is connected and forwarding traffic.
InactiveThe client disconnected; a grace period runs before cleanup.
DisabledExplicitly paused by an admin; new connections are rejected.

Automatic cleanup

Reserved tunnels that never activate, and Inactive tunnels that never reconnect, are swept after a TTL. Active and Disabled tunnels are never auto-removed — they reflect explicit intent.

Reconciliation-friendly by design

Tunnel reservations are managed through idempotent operations: creating a tunnel with the same desired spec twice converges to the same state, and deletes are idempotent too. This makes the API safe to drive from scripts, CLIs that retry, and IaC tooling. See Server & admin → API.

On this page