MCPcopy Index your code
hub / github.com/goproxyio/goproxy

github.com/goproxyio/goproxy @v2.0.7 sqlite

repository ↗ · DeepWiki ↗ · release v2.0.7 ↗
78 symbols 190 edges 11 files 55 documented · 71%
README

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.

Extension points exported contracts — how you extend this code

ServerOps (Interface)
A ServerOps provides the external operations (accessing module information and so on) needed by the Server. [1 implementers]
proxy/server.go
File (Interface)
A File is a file to be served, typically an *os.File or the result of calling MemFile or NewInfo. The modification time [1 …
proxy/server.go

Core symbols most depended-on inside this repo

status
called by 9
proxy/metrics.go
Close
called by 8
proxy/server.go
ModTime
called by 6
proxy/server.go
WriteHeader
called by 5
main.go
download
called by 4
main.go
Stat
called by 4
proxy/server.go
WriteFile
called by 4
renameio/renameio.go
goJSON
called by 3
main.go

Shape

Function 36
Method 30
Struct 10
Interface 2

Languages

Go100%

Modules by API surface

proxy/server.go25 symbols
main.go17 symbols
proxy/router.go7 symbols
robustio/robustio_windows.go5 symbols
renameio/renameio.go5 symbols
proxy/metrics.go5 symbols
sumdb/handler.go4 symbols
robustio/robustio_other.go4 symbols
robustio/robustio.go4 symbols
renameio/umask_test.go1 symbols
renameio/renameio_test.go1 symbols

Dependencies from manifests, versioned

github.com/goproxyio/windowsv0.0.0-2019112603381 · 1×
golang.org/x/modv0.4.0 · 1×

For agents

$ claude mcp add goproxy \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact