Port forwarding
Remote forwarding
Let a server reach a service running on your Mac or in your network.
Example
You’re building a web app on your Mac at localhost:3000 and want a service on web-server to send webhooks to it.
- In Port Forwarding, click New Forwarding and choose Remote.
- Connect via host:
web-server. - Requested remote listener: port
8080. This is the port that opens on the server. - Destination:
127.0.0.1, port3000. - Click Save & Connect.
Everything that reaches port 8080 on the server now arrives at your app on port 3000.
Good to know
- The destination is seen from your Mac. It can be your Mac itself or another machine on your network.
- Most servers accept connections to the forwarded port only from the server itself. To open it to other machines, the server must allow it (
GatewayPortsin its SSH settings).
If you’re used to the command line
This does the same as:
ssh -R 8080:127.0.0.1:3000 user@web-server
-Rmeans a remote tunnel8080is the port in Requested remote listener127.0.0.1:3000is the Destinationuser@web-serveris the host in Connect via Host
You don’t need to run this command: Termbit sets everything up for you.