Package org.eclipse.remote.core
Interface IRemotePortForwardingService
- All Superinterfaces:
IRemoteConnection.Service
A connection service for setting up port forwarding between the host and the remote.
This is a feature provided by SSH.
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.remote.core.IRemoteConnection.Service
IRemoteConnection.Service.Factory
-
Method Summary
Modifier and TypeMethodDescriptionvoid
forwardLocalPort
(int localPort, String fwdAddress, int fwdPort) Forward local port localPort to remote port fwdPort on remote machine fwdAddress.int
forwardLocalPort
(String fwdAddress, int fwdPort, org.eclipse.core.runtime.IProgressMonitor monitor) Forward a local port to remote port fwdPort on remote machine fwdAddress.void
forwardRemotePort
(int remotePort, String fwdAddress, int fwdPort) Forward remote port remotePort to port fwdPort on machine fwdAddress.int
forwardRemotePort
(String fwdAddress, int fwdPort, org.eclipse.core.runtime.IProgressMonitor monitor) Forward a remote port to port fwdPort on remote machine fwdAddress.void
removeLocalPortForwarding
(int port) Remove the local port forwarding associated with the given port.void
removeRemotePortForwarding
(int port) Remove the remote port forwarding associated with the given port.Methods inherited from interface org.eclipse.remote.core.IRemoteConnection.Service
getRemoteConnection
-
Method Details
-
forwardLocalPort
void forwardLocalPort(int localPort, String fwdAddress, int fwdPort) throws RemoteConnectionException Forward local port localPort to remote port fwdPort on remote machine fwdAddress. If this IRemoteConnection is not to fwdAddress, the port will be routed via the connection machine to fwdAddress.- Parameters:
localPort
- local port to forwardfwdAddress
- address of remote machinefwdPort
- remote port on remote machine- Throws:
RemoteConnectionException
-
forwardLocalPort
int forwardLocalPort(String fwdAddress, int fwdPort, org.eclipse.core.runtime.IProgressMonitor monitor) throws RemoteConnectionException Forward a local port to remote port fwdPort on remote machine fwdAddress. The local port is chosen dynamically and returned by the method. If this IRemoteConnection is not to fwdAddress, the port will be routed via the connection machine to fwdAddress.- Parameters:
fwdAddress
-fwdPort
-monitor
-- Returns:
- local port number
- Throws:
RemoteConnectionException
-
forwardRemotePort
void forwardRemotePort(int remotePort, String fwdAddress, int fwdPort) throws RemoteConnectionException Forward remote port remotePort to port fwdPort on machine fwdAddress. When a connection is made to remotePort on the remote machine, it is forwarded via this IRemoteConnection to fwdPort on machine fwdAddress.- Parameters:
remotePort
- remote port to forwardfwdAddress
- address of recipient machinefwdPort
- port on recipient machine- Throws:
RemoteConnectionException
-
forwardRemotePort
int forwardRemotePort(String fwdAddress, int fwdPort, org.eclipse.core.runtime.IProgressMonitor monitor) throws RemoteConnectionException Forward a remote port to port fwdPort on remote machine fwdAddress. The remote port is chosen dynamically and returned by the method. When a connection is made to this port on the remote machine, it is forwarded via this IRemoteConnection to fwdPort on machine fwdAddress. If fwdAddress is the empty string ("") then the fwdPort will be bound to any address on all interfaces. Note that this requires enabling the GatewayPort sshd option on some systems.- Parameters:
fwdAddress
-fwdPort
-monitor
-- Returns:
- remote port number
- Throws:
RemoteConnectionException
-
removeLocalPortForwarding
Remove the local port forwarding associated with the given port.- Parameters:
port
- forwarded port- Throws:
RemoteConnectionException
- Since:
- 7.0
-
removeRemotePortForwarding
Remove the remote port forwarding associated with the given port.- Parameters:
port
- forwarded port- Throws:
RemoteConnectionException
- Since:
- 7.0
-