Interface PortForwardingManager

    • Method Detail

      • 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
      • 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
      • 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