Class ForwardingChannel<T extends SshContext>

java.lang.Object
com.sshtools.synergy.ssh.ChannelNG<T>
com.sshtools.synergy.ssh.ForwardingChannel<T>
All Implemented Interfaces:
Channel
Direct Known Subclasses:
SocketForwardingChannel

public abstract class ForwardingChannel<T extends SshContext> extends ChannelNG<T>

An abstract forwarding channel implementation for use with both local and remote forwarding operations.

A forwarding channel acts as a tunnel, connections are listened for at the tunnel start point and any data is forwarded from the start point through the ssh connection and then onto the end point. Local forwards have the tunnel start point on the client, and the data flows from the start point through the client, along the ssh connection to the server, out to the endpoint which can be anywhere. Remote forwards have the tunnel start point on the Server, and the data flows from the start point through the server, along the ssh connection to the client, out to the endpoint which can be anywhere.
  • Field Details

    • hostToConnect

      protected String hostToConnect
      Tunnel endpoint hostname
    • portToConnect

      protected int portToConnect
      Tunnel endpoint port number
    • originatingHost

      protected String originatingHost
      Tunnel startpoint hostname
    • originatingPort

      protected int originatingPort
      Tunnel startpoint port number
  • Constructor Details

    • ForwardingChannel

      public ForwardingChannel(String channelType, int maximumPacketSize, com.sshtools.common.util.UnsignedInteger32 initialWindowSize, com.sshtools.common.util.UnsignedInteger32 maximumWindowSpace, com.sshtools.common.util.UnsignedInteger32 minimumWindowSpace)
      Construct the forwarding channel.
      Parameters:
      channelType - String
      maximumPacket - int
      windowSize - int
      See Also:
      • com.sshtools.synergy.ssh.ChannelNG#Channel(String channelType, int maximumPacketSize, int initialWindowSize)
    • ForwardingChannel

      public ForwardingChannel(String channelType, int maximumPacketSize, com.sshtools.common.util.UnsignedInteger32 initialWindowSize, com.sshtools.common.util.UnsignedInteger32 maximumWindowSpace, com.sshtools.common.util.UnsignedInteger32 minimumWindowSpace, boolean autoConsume)
  • Method Details

    • getHost

      public String getHost()
      The hostname of the endpoint of tunnel.
      Returns:
      String
    • getPort

      public int getPort()
      The port number of the endpoint of tunnel.
      Returns:
      int
    • getOriginatingHost

      public String getOriginatingHost()
      The hostname of the startpoint of tunnel.
      Returns:
      String
    • getOriginatingPort

      public int getOriginatingPort()
      The port number of the startpoint of tunnel.
      Returns:
      int