Class LocalPortForwarder


  • public class LocalPortForwarder
    extends java.lang.Object
    A LocalPortForwarder forwards TCP/IP connections to a local port via the secure tunnel to another host (which may or may not be identical to the remote SSH-2 server). Checkout Connection.createLocalPortForwarder(int, String, int) on how to create one.
    Version:
    $Id: LocalPortForwarder.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $
    • Constructor Detail

      • LocalPortForwarder

        LocalPortForwarder​(ChannelManager cm,
                           int local_port,
                           java.lang.String host_to_connect,
                           int port_to_connect)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • LocalPortForwarder

        LocalPortForwarder​(ChannelManager cm,
                           java.net.InetSocketAddress addr,
                           java.lang.String host_to_connect,
                           int port_to_connect)
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Stop TCP/IP forwarding of newly arriving connections.
        Throws:
        java.io.IOException - the io exception
      • getLocalPort

        public int getLocalPort()