Commit Graph

3 Commits

Author SHA1 Message Date
bfu4
23b99eba9c
man 2021-11-18 20:07:30 -05:00
Marc Fielding
c072a10770 Support port forwarding of literal IPv6 addresses (#85)
* Support port forwarding of literal IPv6 addresses

To disambiguate between colons as host:port separators and as IPv6 address separators, literal IPv6 addresses use square brackets around the address (https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers).  So host ::1, port 22 is written as [::1]:22, and therefore a simple concatenation of host, colon, and port doesn't work.  Fortunately net.JoinHostPort already implements this functionality, so with a bit of type gymnastics we can generate dest in an IPv6-safe way.

* Support port forwarding of literal IPv6 addresses

To disambiguate between colons as host:port separators and as IPv6 address separators, literal IPv6 addresses use square brackets around the address (https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_network_resource_identifiers).  So host ::1, port 22 is written as [::1]:22, and therefore a simple concatenation of host, colon, and port doesn't work.  Fortunately net.JoinHostPort already implements this functionality, so with a bit of type gymnastics we can generate dest in an IPv6-safe way.
2018-09-23 19:41:38 -05:00
Mahmood Ali
20a454724d Support for local port forwarding (#38)
* Support local port forwarding
* refactor testSession to return ssh client as well
* Tests for local port forwarding
2017-04-28 17:54:12 -05:00