Add support for TCP port forwarding. #4
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
SSH provides for the valuable feature of remote and local TCP port
forwarding. This allows SSH clients and servers to arrange for TCP
connections to be tunnelled over the SSH connection, exposing machines
at either end of the SSH connection to each other over a secure link.
This allows a sort of "poor man's VPN" that can be established using the
existing SSH infrastructure, which is often sufficient to enable a wide
range of use cases. We should support it too.
Modifications:
Wide-ranging. Added the idea of an SSH channel type, added support for
exposing those in the channel initializer callbacks, plumbed through
support for global requests in the form of a global request delegate,
and many more. Substantially reworked a bunch of the API and internals,
basically.
Result:
Remote and local TCP port forwarding work swimmingly well.