mac执行dep ensure 遇到golang.org http meta failed 问题处理

栏目: Go · 发布时间: 7年前

内容简介:执行 dev ensure -v 遇到如下错误错误输出是访问golang.org超时,应该是GFW问题。已经安装了shadowsocks配置代理, 无奈终端不能用。需要把socks5 代理转换成 http 代理,然后使用 http_proxy 环境变量, 这样间接实现命令行使用socks5 代理。默认已经启用了shadowsocks且本地代理为socks5://127.0.0.1:1080

执行 dev ensure -v 遇到如下错误

The following errors occurred while deducing packages:
  * "golang.org/x/net/http2": unable to deduce repository and source type for
  "golang.org/x/net/http2": unable to read metadata: unable to fetch raw metadata: failed
  HTTP request to URL "http://golang.org/x/net/http2?go-get=1": Get 
  http://golang.org/x/net/http2?go-get=1: dial tcp 216.239.37.1:80: i/o timeout

错误输出是访问golang.org超时,应该是GFW问题。已经安装了shadowsocks配置代理, 无奈终端不能用。需要把socks5 代理转换成 http 代理,然后使用 http_proxy 环境变量, 这样间接实现命令行使用socks5 代理。

默认已经启用了shadowsocks且本地代理为socks5://127.0.0.1:1080

使用polipo 来做代理转换器。

  1. 安装polipo
brew install polipo
  1. 代理转换

执行如下命令,开启代理转换器,转换后的代理监听8123端口

polipo socksParentProxy=127.0.0.1:1080 proxyAddress=0.0.0.0
  1. 通过转换代理执行命令

执行如下命令,就通过8123的http代理访问golang.org

env http_proxy=http://127.0.0.1:8123 https_proxy=http://127.0.0.1:8123 dep ensure -v

以上所述就是小编给大家介绍的《mac执行dep ensure 遇到golang.org http meta failed 问题处理》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Head First Design Patterns

Head First Design Patterns

Elisabeth Freeman、Eric Freeman、Bert Bates、Kathy Sierra、Elisabeth Robson / O'Reilly Media / 2004-11-1 / USD 49.99

You're not alone. At any given moment, somewhere in the world someone struggles with the same software design problems you have. You know you don't want to reinvent the wheel (or worse, a flat tire),......一起来看看 《Head First Design Patterns》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具