- openport
- netcat
NB: server and client can be the same machine.
NB: on first Openport run it's necessary to visit a URL before traffic will be forwarded
- Server
- Terminal 1: run a local server on port 6000
nc -k -l 6000
. In reality this would be your real server process. - Terminal 2: use Openport to allow remote SSH connections to local port 22 (a local SSH daemon must be running - on macOS this is "Remote Login" in the Sharing system preferences pane):
openport 22
- Terminal 1: run a local server on port 6000
- Client
- Terminal 1: start an ssh tunnel
ssh -NL 7000:127.0.0.1:6000 openport.io -p $OPENPORT_PORT
, replacing$OPENPORT_PORT
with the port reported by Openport. If prompted for a password, use the server password. - Terminal 2:
echo "Hello world" | nc localhost 7000
- output should appear on server
- Terminal 1: start an ssh tunnel