Need help with goproxy?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

5.0K Stars 329 Forks MIT License 105 Commits 12 Opened issues


A global proxy for Go modules.

Services available


Need anything else?

Contributors list


CircleCI Go Report Card GoDoc

A global proxy for go modules. see:


It invokes the local go command to answer requests.
The default cacheDir is GOPATH, you can set it up by yourself according to the situation.


git clone
cd goproxy


Proxy mode

./bin/goproxy -listen= -cacheDir=/tmp/test

If you run

go get -v pkg
in the proxy machine, should set a new GOPATH which is different from the old GOPATH, or mayebe deadlock. See the file test/

Router mode

./bin/goproxy -listen= -proxy

Use the -proxy flag switch to "Router mode", which implements route filter to routing private module or public module .

                      +----------------------------------> private repo
                  +---+---+           +----------+
go get  +-------> |goproxy| +-------> || +--->
                  +-------+           +----------+
                 router mode           proxy mode

In Router mode, use the -exclude flag set pattern , direct to the repo which match the module path, pattern are matched to the full path specified, not only to the host component.

./bin/goproxy -listen= -cacheDir=/tmp/test -proxy -exclude "*,"

Use docker image

docker run -d -p80:8081 goproxy/goproxy

Use the -v flag to persisting the proxy module data (change cacheDir to your own dir):

docker run -d -p80:8081 -v cacheDir:/go goproxy/goproxy

Docker Compose

docker-compose up


  1. set
    export GOPROXY=http://localhost
    to enable your goproxy.
  2. set
    export GOPROXY=direct
    to disable it.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.