DEV Community

Poor man's ngrok with tcp proxy and ssh reverse tunnel

Kamal Mustafa on November 18, 2017

Updates 2024 I have started using Cloudflare Tunnel lately. It works great for my own use but still figuring out how to make it availabl...
Collapse
 
k4ml profile image
Kamal Mustafa

Alternative to ngrok but simply use ssh as client. Brilliant idea - serveo.net/.

Collapse
 
sonyarianto profile image
Sony AK • Edited

brilliant and game changer :)

Collapse
 
leeeeme profile image
leeee-me

Better to add some fault-and-failover:
-o BatchMode=yes -o ServerAliveCountMax=15 -o ServerAliveInterval=300 -o ExitOnForwardFailure=yes

By the way, ssh cannot help binding privileged ports smaller than 1024, only if we remote ssh as root@remotehost (or any UID 0 identity)... safe but inconvenient.

Collapse
 
k4ml profile image
Kamal Mustafa

Hi, thanks for the tips. Haven't try this but for binding to lower port, maybe we can use setcap to allow tcpproxy to bind to port < 1024.

Collapse
 
abhishekq61 profile image
abhishekq61

You could also give it a try.It provides custom domain for free Staqlab Tunnel
tunnel.staqlab.com