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:/ 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.
Forward a port
- From a link. When a terminal shows a link to
localhost, such ashttp:/, 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./localhost:5173 - 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
0for any free one.
- From a link. Tap a link to
localhostin a terminal, then Open on this phone. chaar forwards the port and opens the page in a browser inside the app. Forward to another port… lets you pick the port on the phone first. - Any port. In a session, tap ⋯ at the top, then Port forwarding. Type the machine's port and tap Forward and open. Leave the port on this phone empty to use the same number, or type
0for any free one.
A green dot on ⋯ means something is forwarded from that machine to this phone.
$ chaar forward add 5173 -m studioIt prints the address to open, such as http:/, and keeps the forward up until you press ctrl-c. --local <port> picks the port here, and 0 picks any free one. See chaar forward.
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.
Open Port forwarding from ⋯. Everything forwarded from the machine is under Forwarded. This phone's have Open, and each has a stop button.
chaar forward list lists them, and chaar forward remove 5173 -m studio stops one.
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 addprints 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, or0. - 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.