Skip to content
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

proposal: net/http2: support proxy/socks for Client #21907

Closed
packman80 opened this issue Sep 16, 2017 · 6 comments
Closed

proposal: net/http2: support proxy/socks for Client #21907

packman80 opened this issue Sep 16, 2017 · 6 comments

Comments

@packman80
Copy link

Go has great http2 client, but it doesn't work through proxy/socks at all. Please, add it in further versions.

@packman80 packman80 changed the title Support proxy/socks for http2 client [Proposal] Support proxy/socks for http2 client Sep 16, 2017
@dsnet dsnet changed the title [Proposal] Support proxy/socks for http2 client proposal: net/http: support proxy/socks for Client Sep 16, 2017
@gopherbot gopherbot added this to the Proposal milestone Sep 16, 2017
@ianlancetaylor
Copy link
Member

CC @tombergan

@odeke-em
Copy link
Member

Thank you for the request @packman80.
I am not too sure about this, but it seems like SOCKS5 support for clients was added in https://go-review.googlesource.com/c/go/+/35488 for Go1.9,
and then in the net repository there is https://godoc.org/golang.org/x/net/proxy#SOCKS5 from which I believe you can make a custom dialer to add to your transport.

For starters, could you please provide a code snippet reproducing what wasn't working? Also your Go version?

@packman80 packman80 changed the title proposal: net/http: support proxy/socks for Client proposal: net/http2: support proxy/socks for Client Sep 17, 2017
@packman80
Copy link
Author

packman80 commented Sep 17, 2017

It's about http2 client (net/http2). net/http has support proxy/socks in transport.go, but net/http2 (no implemented methods in transport.go) doesn't support it. I edited title.

@tombergan
Copy link
Contributor

Can you explain why you need to use SOCKS with x/net/http2 instead of net/http? SOCKS is not part of HTTP/2 so I would lean towards not adding support there unless there is a good motivating use case.

Also, can you clarify whether you are talking about SOCKS or CONNECT?

@rsc
Copy link
Contributor

rsc commented Sep 25, 2017

Ping @packman80, can you reply to @tombergan's questions above? Thanks.

@rsc
Copy link
Contributor

rsc commented Oct 16, 2017

We believe that when you use HTTP2 via net/http, which is the suggested way, then the $HTTP_PROXY environment variable is respected and socks works fine as a way to create new connections to specific hosts (and then net/http runs HTTP2 over those as possible).

Given lack of response above, closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants