Created
April 7, 2010 21:03
-
-
Save brettbuddin/359458 to your computer and use it in GitHub Desktop.
Creates a tunnel between a remote server and your local machine. I use this for showing off what's currently in development to outside users. It could also be used for testing against APIs that need to see your machine.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TUNNEL_USERNAME = "deploy" | |
TUNNEL_HOST = "255.255.255.255" | |
TUNNEL_PORT = 3000 | |
LOCAL_PORT = 3000 | |
desc "Tunnel to a remote host" | |
task :tunnel => :environment do | |
puts "Tunnel established from #{TUNNEL_HOST}:#{TUNNEL_PORT} to 127.0.0.1:#{LOCAL_PORT}" | |
system "ssh -nNT -g -R *:#{TUNNEL_PORT}:127.0.0.1:#{LOCAL_PORT} #{TUNNEL_USERNAME}@#{TUNNEL_HOST}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment