Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport for local port forwarding #38
Conversation
c6c9ddd
to
2a9c1a2
| @@ -42,6 +42,9 @@ type PasswordHandler func(ctx Context, password string) bool | |||
| // PtyCallback is a hook for allowing PTY sessions. | |||
| type PtyCallback func(ctx Context, pty Pty) bool | |||
|
|
|||
| // LocalPortForwardingCallback is a hook for allowing port forwarding | |||
| type LocalPortForwardingCallback func(ctx Context, destinationHost string, destinationPort uint32) bool | |||
notnoopci
Apr 27, 2017
Author
Contributor
I chose plain parameters here rather than a typed struct, mostly because I'm unhappy with the names - and it's easier to change parameter names than struct field names and I don't envision more parameters so far. Happy to change it if I get definitive names.
I chose plain parameters here rather than a typed struct, mostly because I'm unhappy with the names - and it's easier to change parameter names than struct field names and I don't envision more parameters so far. Happy to change it if I get definitive names.
progrium
Apr 28, 2017
Contributor
How are you unhappy with the names? Are these what are used in the protocol spec?
How are you unhappy with the names? Are these what are used in the protocol spec?
35aca29
to
2de60e8
| var dialer net.Dialer | ||
| dconn, err := dialer.DialContext(ctx, "tcp", dest) | ||
| if err != nil { | ||
| newChan.Reject(gossh.ConnectionFailed, err.Error()) |
notnoopci
Apr 27, 2017
Author
Contributor
The rejects reasons and messages are are approximate and don't match the behavior of OpenSSH server - don't see expected rejection reasons in the spec for these cases.
The rejects reasons and messages are are approximate and don't match the behavior of OpenSSH server - don't see expected rejection reasons in the spec for these cases.
|
Overall this looks great. Simple and follows our conventions so far. I'd love to see some tests. Also we'd love to see remote forwarding and SOCKS, but keep in mind we'll probably change the public API a bit afterwards to simplify and would love to have your feedback in that process. |
|
Updated with tests! Thanks! Also, expect an attribution notice for CircleCI 2.0 very soon! |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Permit use of local port forwarding (e.g.
ssh -L 8080:example.com:80 ssh-server).Due to our needs (at CircleCI) so far, I'm restricting this to local port forwarding. If it matches conventions or pattern, we can contribute remote port forwarding and SOCKS as well in a follow up PR.
Few considerations made to call out:
LocalPortForwardingname in the public API thinking it matches the high level nature of the library. Open for ideas there.