Configure your Go environment in mainland China to install packages at full speed without a VPN by switching to goproxy.cn.
Verify that Go modules downloaded through goproxy.cn have not been tampered with using the official Go checksum database.
Build your own Go module proxy using the underlying Goproxy library that powers goproxy.cn.
Goproxy.cn is a free Go module proxy hosted in China that solves a specific problem: many Go packages are unavailable or very slow to download from inside mainland China due to network restrictions. The official Go module proxy (proxy.golang.org) is blocked in mainland China, and packages hosted on golang.org are similarly inaccessible. Goproxy.cn mirrors those modules and serves them through a CDN, so Go developers in China can install packages at normal speeds without needing a VPN. Setting it up takes two commands. You enable Go modules with go env -w GO111MODULE=on, then point Go to the proxy with go env -w GOPROXY=https://goproxy.cn,direct. On macOS, Linux, or Windows, the equivalent environment variable changes also work. After that, go get, go install, and go mod tidy all route through goproxy.cn automatically. The service caches module files in their original, unmodified form. You can verify that cached modules have not been tampered with using the official Go checksum database (sum.golang.org), which goproxy.cn supports. This makes the proxy safe to use in addition to convenient. Goproxy.cn is a non-profit project supported by Qiniu Cloud, a Chinese cloud provider that supplies the servers, object storage, and CDN. It is ICP licensed, meaning it is fully legal to operate in China. DigitalOcean provides additional infrastructure for stats and backups, and Atlassian provides the status page tooling. The repository itself is the web application that runs the goproxy.cn service. If you want to build your own Go module proxy rather than use this hosted service, a separate library called Goproxy underpins this project and is available independently.
← goproxy on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.