Prized docs

Ports.

Start a server on the box and open it on your laptop as localhost, with no flags or config. Mirroring is on by default and takes a few seconds.

How it works

The agent on the box watches for listening TCP ports. When one appears, the daemon on your Mac opens the same port on 127.0.0.1 and tunnels it to the box. Servers that bind only to the box's loopback, like Vite and most dev servers, are relayed by the agent. Websockets are supported.

you@box ~/code/myproject
npm run dev
# ready on http://localhost:3000
# two seconds later, localhost:3000 works on your Mac

Inspect and toggle

prized ports ls lists every box listener with its process and mirror state. prized ports toggle 3000 flips a port off or back on, and the preference persists across restarts.

Both commands describe the box in the config you point them at. If that is not the box the daemon is serving (--config or PRIZED_CONFIG for a second box), ports ls still lists that box's listeners but shows the mirror state as unknown (daemon serves <other box>), and toggle is refused, since the mirrors that exist belong to the other box. Make the box you want mirrored the default with prized init --force, or forward a single port by hand with prized proxy.

Limits

Mirroring is TCP only; UDP is not forwarded. Auto-mirroring covers ports 3000 through 9999, and the range and the per-port allow and never lists are configurable in the config's [ports] section. Ports below 1024, port 22, and the agent's own port 7377 are never mirrored, and 5900 is excluded by default; anything else outside the range needs an allow-list entry or a manual prized proxy.

If something on your Mac already listens on a port, the local process wins and the mirror waits. Every mirrored request also crosses the network, so an app that makes hundreds of database round trips per page should run next to its database on the box, with only the app port mirrored.

Forward a port by hand

Automatic mirroring covers your configured box. For a one-off forward, or another box, use prized proxy box-3fa9 5432, which forwards 127.0.0.1:5432 to that box until you press Ctrl-C. An interactive prized ssh session to a non-default box forwards that box's ports for the life of the session.

Something unclear or out of date?

On this page