社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
用 goproxy 在 heroku 自建 go modules 代理。
App name 是一个唯一的 app名字
Choose a region 有美国和欧洲可以选。个人认为美国的速度还不错。会在region里随机分配一个节点给你,有的节点很快,有的比较慢。不过还是会比 goproxy.io 之类的快。
点 Create app ,等一会就部署完成了。
linux:export GOPROXY=https://youappname.herokuapp.com
windows:$env:GOPROXY = "https://youappname.herokuapp.com"
https://youappname.herokuapp.com
.Note: This proxy can’t fetch your private repos of course.
youappname
是你Crate New App 时的 App name
可以用这个链接测试一下: https://youappname.herokuapp.com/github.com/nsqio/nsq/@v/list
或者你知道明确版本的放可以构造url直接下载 : https://goproxyus.herokuapp.com/github.com/node-pinus/pinus/@v/v1.3.10.zip
export GOPROXY="https://athens.azurefd.net"
export GOPROXY="https://goproxy.io"
export GOPROXY="https://goproxyus.herokuapp.com"
export GOPROXY="https://goproxy.cn"
# 最新官方的
export GOPROXY="https://proxy.golang.org"
别忘记开启golang的 modules 特性。
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!