TCP tunnels
TCP tunnels forward raw bytes — anything that speaks TCP, lrok can carry. Common targets: Postgres, MySQL, Redis, MongoDB, SSH, game servers, IoT devices.
Quick start
$ lrok tcp 5432
Forwarding tcp://lrok.io:42017 -> tcp://127.0.0.1:5432Connect from anywhere using the printed host and port. Connections terminate when you stop the CLI (Ctrl+C).
When to use TCP vs HTTP
- Use
lrok httpwhen your service speaks HTTP/1.1, HTTP/2, or WebSockets — you get TLS, the inspector, and a nice subdomain. - Use
lrok tcpfor everything else: databases, custom protocols, raw sockets. There is no inspector for TCP since the bytes are opaque.
Port allocation
TCP tunnels are exposed on a random high-numbered port on the lrok edge. The port is stable for the lifetime of the session and released when the tunnel closes. If you need a fixed port, contact us — Pro plans can pin a port to your account on request.
# Tunnel a Redis instance for a teammate
$ lrok tcp 6379
Forwarding tcp://lrok.io:38421 -> tcp://127.0.0.1:6379
$ redis-cli -h lrok.io -p 38421 ping
PONG