Run a local Go module proxy to cache all dependency downloads for a development team behind a corporate firewall
Route private internal Go packages directly to their source while forwarding public packages through the upstream proxy
Deploy GOPROXY on Kubernetes with a persistent volume so builds never depend on the public internet
Configure git authentication tokens so the proxy can automatically fetch private repository packages
Requires setting the GOPATH proxy env variable and configuring git credentials for any private repositories.
GOPROXY is a server you run to act as a middleman when Go developers download packages. When a Go programmer runs a command to fetch a dependency, it can be redirected through this proxy rather than going directly to the original source. The proxy fetches the package, stores a local copy, and serves it on future requests. This is useful when developers are behind firewalls that block external sites, or when a team wants to guarantee that package downloads stay fast and consistent. The simplest way to run it is in proxy mode, where you start it on a port and point your Go environment to it. It then forwards requests to a public proxy, such as goproxy.io, and caches what it fetches. You set the cache directory to choose where packages are stored on disk. Router mode adds the ability to split traffic between private and public packages. You configure an exclusion pattern using glob syntax. Packages matching that pattern are fetched directly from their source repository, while everything else goes through the upstream proxy. This is designed for organizations that have private code repositories alongside their use of open-source Go packages. The README includes a diagram showing how requests flow through the router. Authentication for private repositories works by configuring git to rewrite URLs with a personal access token, which the proxy then uses automatically when it clones private code. The README shows the exact git command needed and notes that the same approach works with other git hosting providers. GOPROXY can be deployed as a Docker container or in Kubernetes. The README provides ready-made configuration files for both, including how to persist the package cache as a volume and how to supply a git credentials secret to the deployment. For local testing, you point Go at the proxy by setting an environment variable.
← goproxyio on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.