Skip to content

net/http: ProxyFromEnvironment does not support socks5 #18508

@bruceauyeung

Description

@bruceauyeung

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

go version go1.7.4 linux/amd64

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

actually it's Manjaro

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/bruce/go_ext_path"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build134643851=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

What did you do?

git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
export http_proxy=socks5://127.0.0.1:1080
export https_proxy=socks5://127.0.0.1:1080
go get -u -v github.com/zmb3/gogetdoc

What did you expect to see?

Git can use socks5 proxy to clone a repo, so i expect go get can use socks5 proxy to download/update package github.com/zmb3/gogetdoc

What did you see instead?

github.com/zmb3/gogetdoc (download)
Fetching https://golang.org/x/tools/go/buildutil?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/buildutil?go-get=1: http: error connecting to proxy http://socks5://127.0.0.1:1080: dial tcp 59.50.43.82:0: i/o timeout
package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?go-get=1: http: error connecting to proxy http://socks5://127.0.0.1:1080: dial tcp 59.50.43.82:0: i/o timeout)
Fetching https://golang.org/x/tools/go/loader?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/loader?go-get=1: http: error connecting to proxy http://socks5://127.0.0.1:1080: dial tcp 59.50.43.82:0: i/o timeout
package golang.org/x/tools/go/loader: unrecognized import path "golang.org/x/tools/go/loader" (https fetch: Get https://golang.org/x/tools/go/loader?go-get=1: http: error connecting to proxy http://socks5://127.0.0.1:1080: dial tcp 59.50.43.82:0: i/o timeout)
[bruce@bruce-manjaro ~]$ set https_proxy=socks5://127.0.0.1:1080
[bruce@bruce-manjaro ~]$ go get -u -v github.com/zmb3/gogetdoc
github.com/zmb3/gogetdoc (download)
Fetching https://golang.org/x/tools/go/buildutil?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/buildutil?go-get=1: http: error connecting to proxy http://socks5://127.0.0.1:1080: dial tcp 59.50.43.82:0: i/o timeout
package golang.org/x/tools/go/buildutil: unrecognized import path "golang.org/x/tools/go/buildutil" (https fetch: Get https://golang.org/x/tools/go/buildutil?go-get=1: http: error connecting to proxy http://socks5://127.0.0.1:1080: dial tcp 59.50.43.82:0: i/o timeout)
Fetching https://golang.org/x/tools/go/loader?go-get=1
https fetch failed: Get https://golang.org/x/tools/go/loader?go-get=1: http: error connecting to proxy http://socks5://127.0.0.1:1080: dial tcp 59.50.43.82:0: i/o timeout
package golang.org/x/tools/go/loader: unrecognized import path "golang.org/x/tools/go/loader" (https fetch: Get https://golang.org/x/tools/go/loader?go-get=1: http: error connecting to proxy http://socks5://127.0.0.1:1080: dial tcp 59.50.43.82:0: i/o timeout)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions