-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/net/proxy: doesn't support socks5h:// protocol #13454
Comments
Sure. Send a change. I'd hope the change has docs referencing any specs, and tests? |
I'll definitely keep it in mind for any patch. I have to admit my understanding of what supporting |
Here is what curl does if socks5h is set https://github.com/bagder/curl/blob/master/lib/socks.c#L569-L573 |
Just glancing at net/proxy/socks5.go in Dial() if ip := net.ParseIP(host); ip != nil {
if ip4 := ip.To4(); ip4 != nil {
buf = append(buf, socks5IP4)
ip = ip4
} else {
buf = append(buf, socks5IP6)
}
buf = append(buf, ip...)
} else {
if len(host) > 255 {
return nil, errors.New("proxy: destination hostname too long: " + host)
}
buf = append(buf, socks5Domain)
buf = append(buf, byte(len(host)))
buf = append(buf, host...)
} Looks like socks5 is already acting like socks5h? |
@dajohi If that's the case, it might just need to be updated to support |
Bumping this, since it's we've seen it cause some failures in docker/docker-machine (17.05). |
Change https://golang.org/cl/156517 mentions this issue: |
This package supports detecting proxies with protocol
socks5://
, e.g.socks5://localhost:5000
, but notsocks5h://
. Since this is a common format (e.g. http://blog.mafr.de/2013/11/24/setting-up-a-socks-proxy-using-openssh/) and other tools such ascurl
support it, this package should likely support it as well. I can potentially submit code to support this if desired.The offending line: https://github.com/golang/net/blob/master/proxy/proxy.go#L81 . Both seem to be valid to
curl
, so perhaps both should be supported.The text was updated successfully, but these errors were encountered: