public interface ForwardingRequestListener
Modifier and Type | Method and Description |
---|---|
SshTransport |
createConnection(String hostToConnect,
int portToConnect)
Create a connection to the specified host.
|
void |
initializeTunnel(SshTunnel tunnel)
Called once a connection has been established and a forwarding channel
is about to be opened.
|
SshTransport createConnection(String hostToConnect, int portToConnect) throws SshException
hostToConnect
- portToConnect
- SshException
SshTransport
void initializeTunnel(SshTunnel tunnel)
public void initializeTunnel(SshTunnel tunnel) { tunnel.addChannelEventListener(new ChannelAdapter() { public void channelOpened(SshChannel channel) { // Cast the channel into a tunnel SshTunnel tunnel = (SshTunnel)channel; // Create a pair of IOStreamConnectors to transfer the data IOStreamConnector tx = new IOStreamConnector(); tx.connect(tunnel.getInputStream(), tunnel.getTransport().getOutputStream()); IOStreamConnector rx = new IOStreamConnector(); tx.connect(tunnel.getTransport().getInputStream(), tunnel.getOutputStream()); } }); }
tunnel
- Copyright © 2024. All rights reserved.