зеркало из https://github.com/golang/build.git
d5abf980d5
In dev mode, the coordinator uses hostPathHandler, which redirects /reverse and /revdial to /farmer.golang.org/reverse, etc. Establishing a revdial connection chokes on this redirect, as there it expects to complete the protocol switch in a single request. Add rudimentary redirect support via a helper so this works in dev mode. Note that linkRewriter must implement http.Hijacker as revdial.ConnHandler type-asserts the http.ResponseWriter to a Hijacker. For golang/go#48803 Change-Id: I191fa6ff17bbd334203430f3c1f2c5e03db407ff Reviewed-on: https://go-review.googlesource.com/c/build/+/354630 Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> |
||
---|---|---|
.. | ||
README.md | ||
revdial.go |
README.md
golang.org/x/build/revdial/v2
Package revdial implements a Dialer and Listener which work together to turn an accepted connection (for instance, a Hijacked HTTP request) into a Dialer which can then create net.Conns connecting back to the original dialer, which then gets a net.Listener accepting those conns.