Package org.apache.sshd.common.forward
Interface PortForwardingManager
- All Superinterfaces:
PortForwardingInformationProvider
- All Known Subinterfaces:
ClientSession
,Forwarder
- All Known Implementing Classes:
AbstractClientSession
,ClientSessionImpl
,DefaultForwarder
- Author:
- Apache MINA SSHD Project
-
Method Summary
Modifier and TypeMethodDescriptionStart dynamic local port forwarding using a SOCKS proxy.default SshdSocketAddress
startLocalPortForwarding
(int localPort, SshdSocketAddress remote) Start forwarding the given local port on the client to the given address on the server.startLocalPortForwarding
(SshdSocketAddress local, SshdSocketAddress remote) Start forwarding the given local address on the client to the given address on the server.startRemotePortForwarding
(SshdSocketAddress remote, SshdSocketAddress local) Start forwarding tcpip from the given address on the server to the given address on the client.void
Stop a previously started dynamic port forwarding.void
Stop forwarding the given local address.void
Stop forwarding of the given remote address.Methods inherited from interface org.apache.sshd.common.forward.PortForwardingInformationProvider
getBoundLocalPortForwards, getBoundRemotePortForward, getLocalForwardsBindings, getRemoteForwardsBindings, getStartedLocalPortForwards, getStartedRemotePortForwards, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort
-
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 allocatedremote
- 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 addressremote
- The remote address- Returns:
- The bound
SshdSocketAddress
- Throws:
IOException
- If failed to create the requested binding
-
stopLocalPortForwarding
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 addressremote
- The remote address- Returns:
- The bound
SshdSocketAddress
- Throws:
IOException
- If failed to create the requested binding
-
stopRemotePortForwarding
Stop forwarding of the given remote address.- Parameters:
remote
- The remote address- Throws:
IOException
- If failed to cancel the requested binding
-
startDynamicPortForwarding
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
Stop a previously started dynamic port forwarding.- Parameters:
local
- The local address- Throws:
IOException
- If failed to cancel the requested binding
-