Module: Dizby::TunnelableRemote
- Included in:
- BidirectionalTunnelStrategy
- Defined in:
- lib/dizby/tunnel/tunnelable_remote.rb
Instance Method Summary collapse
Instance Method Details
#create_remote_tunnel(ssh, client_port)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dizby/tunnel/tunnelable_remote.rb', line 10 def create_remote_tunnel(ssh, client_port) remote_tunnel_port = nil ssh.forward.remote client_port, 'localhost', 0, 'localhost' do |remote_port| remote_tunnel_port = remote_port :no_exception end ssh.loop { remote_tunnel_port.nil? } if remote_tunnel_port == :error fail Net::SSH::Exception, 'remote forwarding request failed' end remote_tunnel_port end |