Expose your private port on a public server, tunneled over SSH

Paul shares a great solution for exposing your local port on a public server using pow and nginx.
I took his idea and added support for specifying identity keys and dropped the need to configure up
pow and nginx. You do need socat installed on the remote machine
doing the port forwarding for my solution.

This works well for me when I need to expose an app running on my local development machine to
the world. Especially helpful when working on Facebook Apps or other services that need to trick to talk
to your localhost.

Install Thor Module:

thor install https://gist.github.com/raw/963052/700a484a9c2d6b0d6842ed2b65f6d3d7e066ecab/tunnel.thor

The tunnel.yml file:

  username: user
  public_host: host.example.com
  public_port: 8088
  local_port: 8088
  identity_file: ~/.ec2/path_to_ssh_key<

Start the tunnel (execute in the same directory as the tunnel.yml file):

thor tunnel:start

Leave a Reply