diff --git a/README.md b/README.md index f1497d0..bc7ab64 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ A global proxy for go modules. see: [https://goproxy.io](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 @@ -18,6 +19,9 @@ A global proxy for go modules. see: [https://goproxy.io](https://goproxy.io) ./bin/goproxy -listen=0.0.0.0:80 -cacheDir=/tmp/test + If you run `go get -v pkg` in the proxy machine, shuold set a new GOPATH which is not different from the old GOPATH, or mayebe deadlock. + See the file test/get_test.sh. + ### Router mode Use the -proxy flag switch to "Router mode", which diff --git a/main.go b/main.go index 53d4e82..b7ee066 100644 --- a/main.go +++ b/main.go @@ -174,7 +174,7 @@ func (*ops) List(ctx context.Context, mpath string) (proxy.File, error) { if err != nil { return nil, err } - file := filepath.Join(downloadRoot, escMod+"/@v/listproxy") + file := filepath.Join(downloadRoot, escMod+"/@v/list") if info, err := os.Stat(file); err == nil && time.Since(info.ModTime()) < listExpire { return os.Open(file) } diff --git a/test/get_test.sh b/test/get_test.sh index 10212b7..d1fb500 100755 --- a/test/get_test.sh +++ b/test/get_test.sh @@ -2,6 +2,7 @@ export GO111MODULE=on export GOPROXY='http://127.0.0.1:8081' +export GOPATH=/tmp/go datafile='test/testdata/get.txt'