-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: Client does not support Hijack #28030
Comments
You've described how you want to do something. What do you actually want to do? (i.e. http://xyproblem.info/) In Go 1.12 the Transport's Response.Body will be writable in some cases (protocol upgrades like WebSockets, CONNECT requests, etc). Maybe that is what you're looking for? |
I'm building an https_proxy that routes through an http server to determine a final http destination. After a target service is determined by the server https proxy dials to, this server hijacks the client connection, and connects to a destination. |
The typical answer for that (whether you're using CONNECT or any other request) is to dial your proxy directly and then https://golang.org/pkg/net/http/#Request.Write your request and https://golang.org/pkg/net/http/#ReadResponse the response. But if you're using CONNECT requests or "Connection: upgrade", you'll be able to do bidirection requests with Go 1.12, assuming a few of these pending CLs get finished up, which I expect. |
We're using Connect and TLS. Writing and Reading HTTP would be MITM, correct? I'm not familiar with |
Seems out of scope. |
…ality Fix #919 BREAKING CHANGE: Remove usage of deprecated httputil.ClientConn in favor of net/http.Client per golang/go#28030. Since HTTP connection hijacking is no longer supported in modern Go, implemented alternative approach for bidirectional TCP communication.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Go 1.11
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Applies to all architectures
What did you expect to see?
I expected to see a design plan for Hijack() of http.Response. I'm not an expert in the
http
package, but that seems to be the ideal place to do Hijacking. If there's still plans to discontinue ClientConn, then there needs to be an alternate way to Hijack() an http connection.What did you see instead?
The issue was disregarded b/c it does not fit cleanly with http2: #8285 .
The text was updated successfully, but these errors were encountered: