Open a TCP tunnel WebSocket
TCP Tunnels
TCP Tunnel WebSocket
Upgrade to a WebSocket that relays binary frames to and from a sandbox-local TCP port.
GET
Open a TCP tunnel WebSocket
Open an authenticated WebSocket tunnel to a TCP port listening inside the sandbox.
Use this endpoint when you need raw TCP byte forwarding, such as VNC, Postgres, Redis, or Chrome DevTools over a private local tunnel. For most users, the
Use the WebSocket endpoint on the sandbox proxy host:
tl sbx tunnel CLI or SDK helper manages this protocol for you.
Endpoint
Example Connection
Authenticate to the sandbox proxy with your API key. The proxy injects the internal forwarded-auth headers that the daemon requires.WebSocket Protocol
After the WebSocket upgrade succeeds, binary frames are relayed verbatim:- Client binary frames are written to
127.0.0.1:<port>inside the sandbox. - Bytes read from that TCP connection are sent back as WebSocket binary frames.
- Text frames are rejected.
Response Semantics
101 Switching Protocolsmeans the tunnel is open.400 Bad Requestmeansportis missing, invalid, or0.401 Unauthorizedmeans authenticated sandbox-proxy forwarding was not present.502 Bad Gatewaymeans nothing accepted the TCP connection on127.0.0.1:<port>inside the sandbox.