Go to file
dependabot[bot] b0c281ea9c
Bump github.com/prometheus/client_golang from 1.9.0 to 1.11.1
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.9.0 to 1.11.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.9.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 04:08:49 +00:00
.circleci Fix typo 2020-02-20 21:48:55 +08:00
.github Create FUNDING.yml 2020-12-13 15:21:06 +08:00
contrib Added a contrib/goproxy.yml Stackfile for Docker Swarm deployment using Traefik 2019-01-14 11:32:10 +08:00
proxy feat: support to set cache expiration 2021-11-08 14:59:42 +08:00
renameio update go.mod to v2 2019-11-16 10:31:43 +08:00
robustio update go.mod 2019-12-04 09:29:53 +08:00
scripts fix (latest & list): 2018-12-26 21:14:10 +08:00
sumdb change sumdb proxy impl 2022-04-15 14:32:59 +08:00
test test: add a new test case 2021-03-04 10:58:13 +08:00
.gitignore Make sure lcean binary file by make clean 2020-03-12 14:31:33 +08:00
Dockerfile add tini for handling zombie processes 2020-11-17 09:47:00 +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 add Sponsors in README 2022-06-20 09:52:22 +08:00
docker-compose.yaml remove duplicate "goproxy" in docker-compose.yaml 2019-08-15 14:24:03 +08:00
go.mod Bump github.com/prometheus/client_golang from 1.9.0 to 1.11.1 2023-02-15 04:08:49 +00:00
go.sum Bump github.com/prometheus/client_golang from 1.9.0 to 1.11.1 2023-02-15 04:08:49 +00:00
main.go chore: fix typo 2022-11-09 17:46:58 +08:00

README.md

GOPROXY

CircleCI Go Report Card GoDoc

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

Requirements

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.

Build

git clone https://github.com/goproxyio/goproxy.git
cd goproxy
make

Started

Proxy mode

./bin/goproxy -listen=0.0.0.0:80 -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/get_test.sh.

Router mode

./bin/goproxy -listen=0.0.0.0:80 -proxy https://goproxy.io

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=direct to disable it.

Sponsors