chaarDocsDownloadConsole

Guides

Forward a port

Open a web server that runs on one of your machines from your computer or your phone, at localhost.

A program on a machine, such as a dev server at localhost:5173, can only be reached on that machine. Forward its port, and http://localhost:5173 works on your computer or phone too: chaar carries each connection to port 5173 on the machine.

Only the device you forward to can open it, because chaar listens on localhost there and nowhere else.

Steps for

Forward a port

  • From a link. When a terminal shows a link to localhost, such as http://localhost:5173, hold ⌘ and click it. Choose Open on this computer: chaar forwards the port and opens the page in your browser. Forward to another port… lets you pick the port here first.
  • Any port. Right-click the machine's card in the sidebar and choose Forward a port, or pick Forward a port from and the machine's name in the command palette. Type the machine's port under Port on and click Forward. Leave Port here empty to use the same number, or type 0 for any free one.

See and stop forwards

Every device sees what's forwarded from a machine, whichever device it goes to, and can stop any of it.

Open Forward a port for the machine. Everything forwarded from it is under Forwarded from. Yours have Open and Stop. Another device's shows its name and Stop.

A forward lasts until it's stopped, from any device, or until:

  • Desktop: you quit the app. One you opened from a link also stops when you close that terminal tab.
  • Phone: the app is closed.
  • Terminal: you press ctrl-c.

When something goes wrong

  • Nothing is listening on the machine's port. The forward starts, but the page doesn't load and the forward's row turns orange with the reason. Start the server on the machine. The desktop says Nothing is listening on the port, with Try again. chaar forward add prints a warning for each connection that fails.
  • The port is taken here. Opening a link then forwards to a free port instead. On the desktop, Opened on localhost: names it. A page that sends you back to the first port, as sign-in pages do, needs that port freed, then Retry on it. In the dialog, the phone's sheet or chaar forward add, pick another port here, or 0.
  • A machine shared with you. Forwarding needs Can run on it: see Share with others. With Can view, the phone says View only: ports can't be forwarded, and the desktop doesn't offer it.

Stuck? Ask in the Discord community.

↑↓Move↩Open