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: ProxyFromEnvironment does not support socks5h #24135

Open
sorsasampo opened this Issue Feb 26, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@sorsasampo

sorsasampo commented Feb 26, 2018

What version of Go are you using (go version)?

go version go1.10 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/go"
GORACE=""
GOROOT="/home/user/go1.10"
GOTMPDIR=""
GOTOOLDIR="/home/user/go1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build712629011=/tmp/go-build -gno-record-gcc-switches"

What did you do?

What did you expect to see?

What did you see instead?

go get does not understand socks5h in HTTPS_PROXY, even though it understands socks5.

For example, to test using the tor proxy:

$ HTTPS_PROXY=socks5h://127.0.0.1:9050 go get -v golang.org/x/tools/cmd/goimports
Fetching https://golang.org/x/tools/cmd/goimports?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/goimports?go-get=1: proxyconnect tcp: dial tcp: lookup socks5h: No address associated with hostname
package golang.org/x/tools/cmd/goimports: unrecognized import path "golang.org/x/tools/cmd/goimports" (https fetch: Get https://golang.org/x/tools/cmd/goimports?go-get=1: proxyconnect tcp: dial tcp: lookup socks5h: No address associated with hostname)

Other tools that understand HTTPS_PROXY also understand socks5h (resolve hostname through the proxy, not locally). curl and yum, for example.

Related to issue #18508.

@bradfitz

This comment has been minimized.

Member

bradfitz commented Feb 26, 2018

Seems reasonable. We need to clean up the x/net/socks* packages first, but then somebody can do this.

/cc @mikioh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment