explaingit

goproxy/goproxy.cn

7,081HTMLAudience · developerComplexity · 1/5Setup · easy

TLDR

A free Go module proxy hosted in China that makes Go package downloads fast and accessible for developers inside mainland China, where the official Go proxy is blocked and golang.org packages are unavailable.

Mindmap

mindmap
  root((goproxy.cn))
    What it solves
      Blocked Go proxy
      Slow package downloads
    How it works
      Module caching
      CDN delivery
      Checksum verification
    Setup
      Two terminal commands
      Works on macOS Linux Windows
    Infrastructure
      Qiniu Cloud hosting
      ICP licensed
      Non-profit project
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Configure your Go environment in mainland China to install packages at full speed without a VPN by switching to goproxy.cn.

USE CASE 2

Verify that Go modules downloaded through goproxy.cn have not been tampered with using the official Go checksum database.

USE CASE 3

Build your own Go module proxy using the underlying Goproxy library that powers goproxy.cn.

Tech stack

GoHTML

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

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.

Copy-paste prompts

Prompt 1
I am a Go developer in mainland China and go get is very slow or fails. Walk me through configuring goproxy.cn as my GOPROXY so packages download at normal speed.
Prompt 2
How do I set goproxy.cn as the GOPROXY on Windows using environment variables instead of go env -w?
Prompt 3
How can I verify that a Go module I downloaded through goproxy.cn has not been modified, using the checksum database?
Prompt 4
I want to build my own Go module proxy similar to goproxy.cn using the Goproxy library. Where do I start?
Open on GitHub → Explain another repo

← goproxy on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.