I saw localtunnel the other day, and being how I am, wanted something similar, but simpler and under my control. Turns out it's basically a shell one-liner. I've wrapped it in a nice function here:
# tunnel a local port to a (random) remote one
# requires 'GatewayPorts yes' in sshd_conf on the remote host
doink() {
[ $1 ] || { echo "usage: doink <host> [port]"; return; }
local port=$(expr $RANDOM % 16384 + 49152)
echo "serving localhost:${2:-80} at $1:$port"
ssh -N $1 -R $port:localhost:${2:-80}
}
It forwards a port (80 by default) to a random high-port on a remote machine over ssh. The only issue is you have to have GatewayPorts yes defined in sshd_config, which is not the default. But then something like doink example.com would serve your localhost's port 80 at http://example.com:someport.