Connection Lifecycle
The complete lifecycle of a tunneled connection.
Tunnel setup
- Agent connects to
SERVER_IP:9000 - Agent sends the agent token for authentication
- Agent sends
REGISTER <port> - Server checks port availability and confirms
- Server starts listening on the public port
Incoming connection
- Public user connects to
SERVER_IP:PUBLIC_PORT - Server generates a UUID (e.g.,
8bab2f9a-b0e2-4db2-8fed-9a8dda8e3aed) - Server sends
CONNECT <uuid>to the agent - Agent connects to the local service on the target port
- Agent opens a new connection to
SERVER_IP:9001 - Agent sends
DATA <uuid> - Server matches the UUID and bridges the connections
- Traffic flows bidirectionally
text
Public User <--> Server:PUBLIC_PORT <--> Server:9001 <--> Agent <--> Local ServiceTeardown
- When the public user disconnects, the data connection is closed
- When the agent disconnects from the control channel, the server releases the public port and closes all associated data connections
- Port ownership is removed, making the port available for other agents