Go to file
ianwoolf 9946403fec fix empty exclude/nil proxy 2019-08-07 11:03:34 +08:00
.circleci add tests for router mode 2019-08-06 10:12:35 +08:00
contrib Added a contrib/goproxy.yml Stackfile for Docker Swarm deployment using Traefik 2019-01-14 11:32:10 +08:00
proxy fix empty exclude/nil proxy 2019-08-07 11:03:34 +08:00
scripts fix (latest & list): 2018-12-26 21:14:10 +08:00
test refactor handlers 2019-07-25 16:20:01 +08:00
.gitignore refactor handlers 2019-07-25 16:20:01 +08:00
Dockerfile update dockerfile add dep 2019-08-01 16:59:52 +08:00
LICENSE Initial commit 2018-08-31 16:27:07 +08:00
Makefile refactor handlers 2019-07-25 16:20:01 +08:00
README.md fix empty exclude/nil proxy 2019-08-07 11:03:34 +08:00
docker-compose.yaml fix docker build 2018-12-27 16:31:10 +08:00
go.mod refactor handlers 2019-07-25 16:20:01 +08:00
go.sum refactor handlers 2019-07-25 16:20:01 +08:00
main.go replace fmt.Fprintf(os.Stderr, ...) with log.Printf() 2019-08-07 10:03:42 +08:00

README.md

GOPROXY CircleCI

A global proxy for go modules. see: https://goproxy.io

Requirements

It invokes the local go command to answer requests.

Build

make

Started

Proxy mode

./bin/goproxy -listen=0.0.0.0:80 -cacheDir=/tmp/test

Router mode

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

                                         direct
                      +----------------------------------> private repo
                      |
                 match|pattern
                      |
                  +---+---+           +----------+
go get  +-------> |goproxy| +-------> |goproxy.io| +---> golang.org/x/net
                  +-------+           +----------+
                 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=0.0.0.0:80 -cacheDir=/tmp/test -proxy https://goproxy.io -exclude "*.corp.example.com,rsc.io/private"

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

Appendix

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