Skip to content

Instantly share code, notes, and snippets.

@imbriaco
Created August 14, 2011 02:14
Show Gist options
  • Save imbriaco/1144486 to your computer and use it in GitHub Desktop.
Save imbriaco/1144486 to your computer and use it in GitHub Desktop.
D, [2011-08-13T22:11:06.310036 #99479] DEBUG -- net.ssh.service.forward[810e839c]: received connection on #<UNIXServer:0x0000010201baf0>
D, [2011-08-13T22:11:06.310289 #99479] DEBUG -- tcpsocket[808a3b28]: queueing packet nr 7 type 90 len 60
D, [2011-08-13T22:11:06.310603 #99479] DEBUG -- tcpsocket[808a3b28]: sent 84 bytes
D, [2011-08-13T22:11:06.337773 #99479] DEBUG -- tcpsocket[808a3b28]: read 52 bytes
D, [2011-08-13T22:11:06.337942 #99479] DEBUG -- tcpsocket[808a3b28]: received packet nr 7 type 91 len 28
I, [2011-08-13T22:11:06.338075 #99479] INFO -- net.ssh.connection.session[810e8518]: channel_open_confirmation: 0 0 2097152 32768
I, [2011-08-13T22:11:06.338156 #99479] INFO -- net.ssh.connection.channel[810df620]: direct channel established
D, [2011-08-13T22:11:09.485092 #99479] DEBUG -- unixsocket[810e23e8]: read 13 bytes
D, [2011-08-13T22:11:09.485237 #99479] DEBUG -- net.ssh.connection.channel[810df620]: read 13 bytes from client, sending over local forwarded connection
D, [2011-08-13T22:11:09.485418 #99479] DEBUG -- tcpsocket[808a3b28]: queueing packet nr 8 type 94 len 28
D, [2011-08-13T22:11:09.485548 #99479] DEBUG -- tcpsocket[808a3b28]: sent 52 bytes
D, [2011-08-13T22:11:16.698696 #99479] DEBUG -- tcpsocket[808a3b28]: read 68 bytes
D, [2011-08-13T22:11:16.698941 #99479] DEBUG -- tcpsocket[808a3b28]: received packet nr 8 type 94 len 44
I, [2011-08-13T22:11:16.699031 #99479] INFO -- net.ssh.connection.session[810e8518]: channel_data: 0 20b
D, [2011-08-13T22:11:16.699084 #99479] DEBUG -- net.ssh.service.forward[810e839c]: data:20 on local forwarded channel
D, [2011-08-13T22:11:16.699204 #99479] DEBUG -- unixsocket[810e23e8]: sent 20 bytes
#!/usr/bin/env ruby
require 'net/ssh'
socket = UNIXServer.open("/tmp/test.socket")
Net::SSH.start(ENV['TUNNEL_HOST'], ENV['TUNNEL_USER'], :key_data => ENV['TUNNEL_SSH_KEY'], :verbose => :debug) do |ssh|
ssh.forward.local(socket, "localhost", 8000)
ssh.loop { true }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment