explaingit

goproxyio/goproxy

5,875GoAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

GOPROXY is a self-hosted Go package proxy server that caches dependencies locally, keeping downloads fast and reliable for teams behind firewalls or needing consistent, controlled package access.

Mindmap

mindmap
  root((repo))
    What It Does
      Caches Go packages
      Proxies download requests
      Serves local copies
    Modes
      Proxy mode
      Router mode
      Private repo split
    Auth
      Git token config
      URL rewriting
      Private repo support
    Deployment
      Docker container
      Kubernetes setup
      Persistent cache volume
    Use Cases
      Firewall bypass
      Consistent builds
      Private package routing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run a local Go module proxy to cache all dependency downloads for a development team behind a corporate firewall

USE CASE 2

Route private internal Go packages directly to their source while forwarding public packages through the upstream proxy

USE CASE 3

Deploy GOPROXY on Kubernetes with a persistent volume so builds never depend on the public internet

USE CASE 4

Configure git authentication tokens so the proxy can automatically fetch private repository packages

Tech stack

GoDockerKubernetes

Getting it running

Difficulty · moderate Time to first run · 30min

Requires setting the GOPATH proxy env variable and configuring git credentials for any private repositories.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me how to start GOPROXY in proxy mode and set the GOPATH environment variable so all Go package downloads are cached through it.
Prompt 2
Write the GOPROXY router configuration to forward private company packages directly to their git source while routing all public packages through goproxy.io.
Prompt 3
Give me the Docker run command to start GOPROXY with a mounted directory for persistent package caching.
Prompt 4
Show me the Kubernetes deployment YAML for GOPROXY that includes a persistent volume for the cache and a secret for git credentials.
Prompt 5
How do I configure git with a personal access token so GOPROXY can automatically authenticate and fetch packages from a private GitHub repository?
Open on GitHub → Explain another repo

← goproxyio on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.