Package org.apache.sshd.common.forward
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SshdSocketAddress
startDynamicPortForwarding(SshdSocketAddress local)
Start 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.SshdSocketAddress
startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote)
Start forwarding the given local address on the client to the given address on the server.SshdSocketAddress
startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local)
Start forwarding tcpip from the given address on the server to the given address on the client.void
stopDynamicPortForwarding(SshdSocketAddress local)
Stop a previously started dynamic port forwarding.void
stopLocalPortForwarding(SshdSocketAddress local)
Stop forwarding the given local address.void
stopRemotePortForwarding(SshdSocketAddress remote)
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 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 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
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 addressremote
- 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
-
-