无法通过HTTP代理“获取”存储库

时间:2017-02-17 10:14:40

标签: go http-proxy

当我尝试安装Burrow https://github.com/linkedin/Burrow#build-and-install

go get github.com/linkedin/Burrow

我收到以下错误:

package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1" 
(https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)

我已经通过以下方式设置了代理:

export http_proxy=myproxy:port
export https_proxy=myproxy:port

修改

go get -u gopkg.in/gcfg.v1

也会出现同样的错误:

package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1" 
(https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)

EDIT1

go get -v gopkg.in/gcfg.v1

Fetching https://gopkg.in/gcfg.v1?go-get=1
https fetch failed: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused
package gopkg.in/gcfg.v1: unrecognized import path "gopkg.in/gcfg.v1" (https fetch: Get https://gopkg.in/gcfg.v1?go-get=1: proxyconnect tcp: dial tcp :0: getsockopt: connection refused)

2 个答案:

答案 0 :(得分:0)

我也遇到了同样的错误。原来我的https代理不正确。确保http和https代理都指向以http开头的同一代理。

export http_proxy=<http://proxy:port>
export http_proxy=<http://proxy:port>

答案 1 :(得分:-2)

我使用以下方法解决了问题:

export https_proxy=$http_proxy

为了更持久的解决方案,可以更新/ etc / environment。