Interface PortForwardingManager

All Superinterfaces:
PortForwardingInformationProvider
All Known Subinterfaces:
ClientSession, Forwarder
All Known Implementing Classes:
AbstractClientSession, ClientSessionImpl, DefaultForwarder

public interface PortForwardingManager extends PortForwardingInformationProvider
Author:
Apache MINA SSHD Project
  • Method Details

    • startLocalPortForwarding

      default SshdSocketAddress startLocalPortForwarding(int localPort, SshdSocketAddress remote) throws IOException
      Start forwarding the given local port on the client to the given address on the server.
      Parameters:
      localPort - The local port - if zero then one will be allocated
      remote - The remote address
      Returns:
      The bound SshdSocketAddress
      Throws:
      IOException - If failed to create the requested binding
    • startLocalPortForwarding

      SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws IOException
      Start forwarding the given local address on the client to the given address on the server.
      Parameters:
      local - The local address
      remote - The remote address
      Returns:
      The bound SshdSocketAddress
      Throws:
      IOException - If failed to create the requested binding
    • stopLocalPortForwarding

      void stopLocalPortForwarding(SshdSocketAddress local) throws IOException
      Stop forwarding the given local address.
      Parameters:
      local - The local address
      Throws:
      IOException - If failed to cancel the requested binding
    • startRemotePortForwarding

      SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws IOException

      Start forwarding tcpip from the given address on the server to the given address on the client.

      The remote host name is the address to bind to on the server:
      • "" means that connections are to be accepted on all protocol families supported by the SSH implementation
      • "0.0.0.0" means to listen on all IPv4 addresses
      • "::" means to listen on all IPv6 addresses
      • "localhost" means to listen on all protocol families supported by the SSH implementation on loopback addresses only, [RFC3330] and RFC3513]
      • "127.0.0.1" and "::1" indicate listening on the loopback interfaces for IPv4 and IPv6 respectively
      Parameters:
      local - The local address
      remote - The remote address
      Returns:
      The bound SshdSocketAddress
      Throws:
      IOException - If failed to create the requested binding
    • stopRemotePortForwarding

      void stopRemotePortForwarding(SshdSocketAddress remote) throws IOException
      Stop forwarding of the given remote address.
      Parameters:
      remote - The remote address
      Throws:
      IOException - If failed to cancel the requested binding
    • startDynamicPortForwarding

      SshdSocketAddress startDynamicPortForwarding(SshdSocketAddress local) throws IOException
      Start dynamic local port forwarding using a SOCKS proxy.
      Parameters:
      local - The local address
      Returns:
      The bound SshdSocketAddress
      Throws:
      IOException - If failed to create the requested binding
    • stopDynamicPortForwarding

      void stopDynamicPortForwarding(SshdSocketAddress local) throws IOException
      Stop a previously started dynamic port forwarding.
      Parameters:
      local - The local address
      Throws:
      IOException - If failed to cancel the requested binding