Name: | ethz.sshLocalPortForward |
Description: | |
Id: | ethz.sshLocalPortForward |
Category: | accessor |
ethz.sshLocalPortForward is an accessor using Active URI syntax with the following base identifiers:
Base |
---|
active:sshLocalPortForward |
and the following arguments: (for more details on argument passing details see here)
Argument | Rules | Typing | Description |
---|---|---|---|
remote | Mandatory | Representation (java.lang.Object) | ssh: URI of the remote server |
forward | Mandatory | Representation (java.lang.Object) | The local port forwarding identifier |
credentials | Mandatory | Representation (java.lang.Object) | The ssh credentials |
The response representation of this accessor for SOURCE requests is unknown.
This accessor throws no documented exceptions.
To use ethz.sshLocalPortForward accessor you must import the module urn:org:netkernel:client:ssh:
active:sshLocalPortForward enables the persistant creation of local port forwarding over SSH.
The remote argument must be an ssh: URI specifying the hostname of the remote ssh server. For example:
ssh://remote.server.com
The credentials argument are the ssh credentials required to connect to the remote host. See credentials section for details.
The forward argument is the same form as the openssh -L port forward switch. It must be an identifier of the form
1070:localhost:1060
To initiate port forward a NEW request must be issued. The identifier of the NEW port forward resource is returned as the response.
To test the existence of a port forward an EXISTS request may be issued. An EXISTS request must be issued with same identifer as was used in the NEW request.
To terminate the port forward and close the underlying ssh conection a DELETE request must be issued with same identifer as was used in the NEW request.
To initiate the port forwarding of a remote servers port 1060 on its localhost adapter, to the client side's local port 1070 do this...
or in NKF form...
req=context.createRequest("active:sshLocalPortForward") req.addArgument("remote", "ssh://server.com") req.addArgument("credentials", "res:/resources/my-ssh-credentials-for-server.com") req.addArgument("forward", "1070:localhost:1060") req.setVerb(INKFRequestReadOnly.VERB_NEW) context.issueRequest(req);
And to subsequently close the port forward...
in NKF form...
req=context.createRequest("active:sshLocalPortForward") req.addArgument("remote", "ssh://server.com") req.addArgument("credentials", "res:/resources/my-ssh-credentials-for-server.com") req.addArgument("forward", "1070:localhost:1060") req.setVerb(INKFRequestReadOnly.VERB_DELETE) context.issueRequest(req);
An established port forward will remain active indefinitely or until explicitly closed with a DELETE request. All open forwarded ports are closed when the SSH module is decommissioned - for example prior to shutdown, or when recommissioning the ssh client module.