Looking for an alternative to ngrok
or localtunnel.me
? Want to host it yourself? All you need is a Linux server to act as a relay.
You need a Linux server from a place like DigitalOcean or Linode. It should have a public IP. We'll call this server the "relay server."
Open vars.sh
and fill the following details:
SERVER_USERNAME=<your relay server username>
SERVER_IP=<your relay server IP>
SERVER_SSH_PORT=<SSH port to connect to the server>
AUTO_SSH_PORT=<SSH port to act as a heartbeat>
DESKTOP_USERNAME=<username of your desktop machine>
You will:
- Need to be able to connect to the relay server from the desktop via a ssh key
- Connect to the desktop from your laptop via a ssh key
vim /etc/ssh/sshd_config
And make sure:
GatewayPorts clientspecified
And then:
sudo /etc/init.d/ssh restart
Run desktop/connect.sh
on your desktop. It'll initiate a session to your relay server.
Run client/connect.sh
to ssh into your desktop.
Run client/forward.sh <PORT>
on your laptop to connect the given ports on your laptop and your desktop. So, if you have Jupyter running on port 8888 on your desktop, then accessing 8888 on your laptop would access the desktop's port 8888.