Skip to main content
A raw port forward opens a TCP or UDP port on the machine’s public address and sends it straight to a port inside the machine. Use it for a Postgres database, an SSH daemon, a game server, or any other protocol that is not HTTP.

How it works

Proxies terminate TLS and route HTTP by domain, which suits web apps and APIs. A raw port forward works one layer down: the packets pass through untouched.
The public port is allocated for you from the 40000 to 60000 range. The endpoint is the machine’s existing DNS name (<machine>.boxd.sh, which resolves to the proxy IP) on that allocated port. A machine in New York uses <machine>.nyc.boxd.sh.

Add a raw port forward

From your laptop:
Anything listening on 5432 inside the machine is now reachable at myapp.boxd.sh:48211. For example, a Postgres client:

Protocols

A forward is TCP by default. Use --udp for UDP, or pass both flags to serve TCP and UDP on the same allocated public port:
Adding a forward again for a port that already has one keeps the same public port and updates the protocol set.

List and remove

From inside a machine

The in-machine CLI has its own command for raw port forwards, boxd machine expose. It targets the machine you are in unless you name another one:
boxd machine expose does not exist in the laptop CLI. See the CLI reference for the full flag list.

Limits

  • Up to 3 raw port forwards per machine. Each allocated public port serves one port inside the machine, in one or both protocols. Remove one before adding a fourth.
  • Owner-only. Only the machine’s owner can add, list, or remove its forwards.
  • Persistent. Forwards persist across reboots and are removed automatically when the machine is deleted.
  • Hibernated machines don’t wake on raw ports yet. It’s on the roadmap. A hibernated machine does wake on an HTTPS request, an SSH connection, boxd machine exec or boxd machine wake, and a machine on standby wakes on raw-port traffic too. So wake it one of those ways first, or keep a machine that serves a raw port from hibernating: boxd machine config set myapp auto-hibernate.timeout 0.
A raw port forward is for non-HTTP traffic. If you are serving a website or an HTTP API, use an HTTPS proxy instead. You get TLS and a clean https://<machine>.boxd.sh URL.