Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11 from mogo/fix_ssh_host_issue

Fixed issue when running localtunnel server on non-standard port.
  • Loading branch information...
commit d5eca8bab37f324221fee5ae7eb3dbdd947d7dc4 2 parents e13b289 + da1a879
@progrium authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/localtunnel/tunnel.rb
View
4 lib/localtunnel/tunnel.rb
@@ -30,7 +30,7 @@ def register_tunnel(key=@key)
puts " [Error] #{resp['error']}"
exit
end
- @host = resp['host']
+ @host = resp['host'].split(':').first
@tunnel = resp
return resp
rescue
@@ -41,7 +41,7 @@ def register_tunnel(key=@key)
def start_tunnel
port = @port
tunnel = @tunnel
- gateway = Net::SSH::Gateway.new(tunnel['host'], tunnel['user'])
+ gateway = Net::SSH::Gateway.new(@host, tunnel['user'])
gateway.open_remote(port.to_i, '127.0.0.1', tunnel['through_port'].to_i) do |rp,rh|
puts " " << tunnel['banner'] if tunnel.has_key? 'banner'
puts " Port #{port} is now publicly accessible from http://#{tunnel['host']} ..."
Please sign in to comment.
Something went wrong with that request. Please try again.