Hi,
I see that TCP/IP forwarding has been added to the SSHD client in the
upcoming 0.8.0 release. I have grabbed the latest code from SVN to try
it out, but I have a few questions:
1. Is there any sample code for how to use it? I basically am doing the
following:
SshClient sshClient = SshClient.setUpDefaultClient();
sshClient.start();
ClientSession clientSession = sshClient.connect( host, port
).await().getSession();
clientSession.authPassword( username, password ).await();
clientSession.startLocalPortForwarding( new SshdSocketAddress(
localAddress, localPort ), new SshdSocketAddress( remoteAddress,
remotePort ) );
I don't want any shell or execution channel, just the port forwarding.
Is that the best way to make use of the feature?
2. When I run the above code, the channel seems to work correctly, until
I disconnect for the first time, at which point the channel seems to
close itself. Is that something I am doing wrong, or is it the intended
behavior? Any other SSH client I have used maintains the forwarded
channel across multiple disconnects/reconnects.
3. I see that there is a createDirectTcpipChannel method in the
ClientSession class as well, that seems to create a completely different
implementation of a forwarded TCP/IP channel. What is that used for?
Thanks,
Kevin Winchester