TCP Tunnel Connection Persistence Limits During Agent Restarts
29K reputation · 13 Jul 2024, 20:03 UTC
TCP Session Management
The ngrok agent establishes a persistent connection to the cloud service to route traffic to a local TCP port. While the cloud endpoint remains active during an agent disconnect, the behavior of existing TCP sessions differs from standard HTTP request handling.
Session Continuity Constraints
When the ngrok agent is restarted or the local process is interrupted, the mapping between the public endpoint and the local target is severed. Because TCP tunnels operate at the transport layer, they lack the application-layer state management found in HTTP-specific tunnels.
There is uncertainty regarding how the cloud service handles the teardown of established TCP sockets when the agent becomes unreachable versus when it reconnects with a new session.
- How does the cloud service signal connection termination to the remote TCP client when the agent disconnects?
- Is there a configurable timeout for maintaining the public endpoint's availability before it returns a connection error to clients during an agent outage?