My Go Module Proxy: Goproxy

Published on

2019-09-12 13:45:02 update

Since I launched goproxy.cn, my personal Go module proxy (aofeisheng.com/goproxy) has been shut down.

Starting with Go 1.11, the Go officially introduced a new feature called Modules, which has greatly inspired my interest in project dependency management. Through an in-depth study of this new feature, I think it will bring the first Deptopia in the history of computer programming for the programming language world. After all, can you imagine a programming language without std libraries? How dreamy it will be!

And with Modules, there is also a Module proxy protocol, through which we can implement the Go module proxy (aka Dependency mirror). It is foreseeable that the future is modular, so a free, trusted, always on, and CDNed module proxy is indispensable for Go developers (especially in countries with Internet censorship). Therefore, I strictly followed the Module proxy protocol to implement a Go module proxy that basically satisfies various conditions. Its name is Goproxy. After thorough testing, it is officially announced here today.

If you trust me enough, then you can use Goproxy with me and help me improve it.

Go 1.13 and above (RECOMMENDED)

Open your terminal and execute

$ go env -w GOPROXY=https://aofeisheng.com/goproxy,direct

done.

macOS or Linux

Open your terminal and execute

$ export GOPROXY=https://aofeisheng.com/goproxy

or

$ echo "export GOPROXY=https://aofeisheng.com/goproxy" >> ~/.profile && source ~/.profile

done.

Windows

Open your PowerShell and execute

C:\> $env:GOPROXY = "https://aofeisheng.com/goproxy"

or

1. Open the Start Search, type in "env" 2. Choose the "Edit the system environment variables" 3. Click the "Environment Variables…" button 4. Under the "User variables for <YOUR_USERNAME>" section (the upper half) 5. Click the "New..." button 6. Choose the "Variable name" input bar, type in "GOPROXY" 7. Choose the "Variable value" input bar, type in "https://aofeisheng.com/goproxy" 8. Click the "OK" button

done.