Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/outray-tunnel/outray/llms.txt

Use this file to discover all available pages before exploring further.

TCP tunnels forward raw TCP traffic from a remote port on OutRay’s servers to a local port on your machine. Unlike HTTP tunnels, TCP tunnels work at the transport layer, so they support any protocol that runs over TCP.

Basic usage

outray tcp 5432
Once the tunnel is open, you’ll see output like:
Connecting to OutRay (TCP mode)...
Linked to your local port 5432
✨ TCP Tunnel ready: tcp.outray.app:43210
Remote port: 43210
Keep this running to keep your tunnel active.
Anyone who connects to tcp.outray.app:43210 will reach your local service on port 5432.

Flags

FlagTypeDescription
--remote-port <port>numberRequest a specific remote port instead of a randomly assigned one.
--org <slug>stringOpen the tunnel under a different organization without switching your active org.
--key <token>stringOverride the auth token. Useful for CI/CD or scripted environments.
--no-logsbooleanSuppress per-connection log output in the terminal.

Connecting to a TCP tunnel

Once the tunnel is open, connect using the remote host and the assigned port number shown in the terminal output.
psql -h tcp.outray.app -p 43210 -U myuser -d mydb

Requesting a specific remote port

By default, OutRay assigns a random available port. Use --remote-port to request a specific one:
outray tcp 5432 --remote-port 20000
If the requested port is already in use, the tunnel will fail with an error. Choose a different port or let OutRay assign one automatically.
Specific port availability is not guaranteed. If the port is taken, you’ll need to pick another one or omit --remote-port to get a randomly assigned port.

Example use cases

Databases

Share a local PostgreSQL, MySQL, or Redis instance with a teammate or connect a remote app to your local dev database.

SSH access

Open a TCP tunnel on port 22 to reach a machine behind a firewall over SSH.

Game servers

Expose a locally running game server so friends can connect without port forwarding.

Custom services

Any TCP-based protocol — SMTP, FTP, Redis, MQTT — works through a TCP tunnel.

Stopping the tunnel

Press Ctrl+C to stop the tunnel. All open connections are closed and the remote port is released.

Build docs developers (and LLMs) love