A minimalist Go module proxy handler.
A minimalist Go module proxy handler.
Goproxy has fully implemented the GOPROXY protocol. The goal of this project is to find the most dead simple way to provide a minimalist handler that can act as a full-featured Go module proxy for those who want to build their own proxies.
goproxy.Goproxy
, goproxy.GoFetcher
, and goproxy.DirCacher
goproxy.Fetcher
and goproxy.Cacher
GOPROXY
, GONOPROXY
, GOSUMDB
, GONOSUMDB
, and GOPRIVATE
GOPROXY
Disable-Module-Fetch
headergo get
it:go get github.com/goproxy/goproxy
go install github.com/goproxy/goproxy/cmd/goproxy@latest
docker pull ghcr.io/goproxy/goproxy
Create a file named goproxy.go
:
package main
import (
"net/http"
"github.com/goproxy/goproxy"
)
func main() {
http.ListenAndServe("localhost:8080", &goproxy.Goproxy{})
}
Then run it with a GOMODCACHE
that differs from go env GOMODCACHE
:
GOMODCACHE=/tmp/goproxy-gomodcache go run goproxy.go
Finally, set GOPROXY
to try it out:
go env -w GOPROXY=http://localhost:8080,direct
For more details, refer to the documentation.
Refer to the Installation section to download or build the binary.
Then run it with a GOMODCACHE
that differs from go env GOMODCACHE
:
GOMODCACHE=/tmp/goproxy-gomodcache goproxy server --address localhost:8080
Finally, set GOPROXY
to try it out:
go env -w GOPROXY=http://localhost:8080,direct
For more details, check its usage:
goproxy --help
Refer to the Installation section to pull the image.
Then run it:
docker run -p 8080:8080 ghcr.io/goproxy/goproxy server --address :8080
Finally, set GOPROXY
to try it out:
go env -w GOPROXY=http://localhost:8080,direct
For more details, check its usage:
docker run ghcr.io/goproxy/goproxy --help
If you have any questions or ideas about this project, feel free to discuss them here.
If you would like to contribute to this project, please submit issues here or pull requests here.
This project is licensed under the MIT License.