Tunnels

Understanding TCP tunnels in Exposr.

What is a tunnel?

In Exposr, a tunnel is a logical connection between a public port on the relay server and a local service on the client machine. When a tunnel is active, any TCP traffic arriving at the public port is forwarded to the local service through the relay server and the Exposr agent.

A tunnel consists of two parts: a persistent control connection that manages the tunnel lifecycle, and one or more data connections that carry the actual traffic.

Tunnel lifecycle

  1. The agent connects to the control port and authenticates
  2. The agent requests a public port (tunnel registration)
  3. The server starts listening on the public port
  4. The tunnel is now active — public connections are forwarded
  5. When the agent disconnects, the server releases the public port

If the agent disconnects unexpectedly, the server detects the broken control connection and cleans up the associated tunnel, releasing the public port for reuse.

Current limitations

Experimental
Exposr v0.4 only supports TCP tunnels. UDP, HTTPS termination, and domain-based routing are planned features.
  • TCP only — no UDP forwarding
  • One tunnel per agent (one public port per control connection)
  • No persistent tunnel configuration — tunnels exist only while the agent is connected
  • No connection keep-alive or pooling for data connections