Port forwarding with net/ssh

I’ve created a simple script to setup local port forwarding using
net/ssh, but I can’t quite get it to work. My main script is
initializing a websphere JMX over SOAP through a firewall.

This ssh command works, I can access port 9075 over localhost
forwarding remotely with no problems:

bash $ ssh chris@dev_server -L 9075:localhost:9075

I’m trying to recreate that in jruby using this small script:

require ‘java’
require ‘rubygems’
require ‘net/ssh’

Net::SSH.start( ‘dev_server’, ‘chris’,:verbose => :info ) do | session|
session.forward.local( 9075, ‘localhost’,9075 )
session.loop{true}
end

This does not work, my SOAP command just hangs there until I kill it.

Any suggestions? I’d rather do this in JRuby without needing to drop
out to command line to create my tunnels.

Chris


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Fri, Oct 2, 2009 at 2:16 PM, Chris E. [email protected] wrote:

Any suggestions? I’d rather do this in JRuby without needing to drop
out to command line to create my tunnels.

Does the same script work ok with C Ruby (if you have it available)?
net/ssh has been one of those libraries that has been hard to get
right due to our not-fully-complete port of openssl.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email