1
0
mirror of https://github.com/goproxy/goproxy.git synced 2020-06-03 17:45:24 +00:00
A minimalist Go module proxy handler. https://godoc.org/github.com/goproxy/goproxy
Go to file
Aofei Sheng 15a5943546 feat: add cacher.MinIO.BucketLocation
Also we exported the `cacher.MinIO.VirtualHosted` to facilitate users.
2020-05-29 15:02:50 +08:00
.github/workflows refactor: use Go 1.12 2020-02-29 22:44:10 +08:00
cacher feat: add cacher.MinIO.BucketLocation 2020-05-29 15:02:50 +08:00
.gitignore chore: add .gitignore 2019-06-03 14:51:06 +08:00
cacher.go docs: refine comments 2020-04-18 01:04:54 +08:00
go.mod feat: add cacher.MinIO.BucketLocation 2020-05-29 15:02:50 +08:00
go.sum feat: add cacher.MinIO.BucketLocation 2020-05-29 15:02:50 +08:00
goproxy.go refactor: improve proxying checksum database support 2020-05-21 18:09:50 +08:00
http.go feat: add httpDo 2020-03-12 23:50:33 +08:00
LICENSE chore: add LICENSE 2019-06-03 14:51:16 +08:00
mod.go refactor: simplify code 2020-03-13 18:50:10 +08:00
README.md refactor: use Go 1.12 2020-02-29 22:44:10 +08:00
response_test.go refactor: speed up info requests 2020-03-02 03:24:12 +08:00
response.go refactor: speed up info requests 2020-03-02 03:24:12 +08:00
sumdb_client_ops.go feat: add httpDo 2020-03-12 23:50:33 +08:00

Goproxy

Go Report Card GoDoc

A minimalist Go module proxy handler.

Goproxy has fully implemented the Go's module proxy protocol. Our goal 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. Yeah, there is no Makefile, no configuration files, no crazy file organization, no lengthy documentation, no annoying stuff, just a goproxy.Goproxy that implements the http.Handler.

Features

Installation

Open your terminal and execute

$ go get github.com/goproxy/goproxy

done.

The only requirement is the Go, at least v1.12.

Quick Start

Create a file named goproxy.go

package main

import (
	"net/http"

	"github.com/goproxy/goproxy"
)

func main() {
	http.ListenAndServe("localhost:8080", goproxy.New())
}

and run it

$ go run goproxy.go

then try it by setting GOPROXY to http://localhost:8080 by following the instructions below. In addition, we also recommend that you set GO111MODULE to on instead of auto when you are working with Go modules.

Open your terminal and execute

$ go env -w GOPROXY=http://localhost:8080,direct

done.

macOS or Linux

Open your terminal and execute

$ export GOPROXY=http://localhost:8080

or

$ echo "export GOPROXY=http://localhost:8080" >> ~/.profile && source ~/.profile

done.

Windows

Open your PowerShell and execute

C:\> $env:GOPROXY = "http://localhost:8080"

or

1. Open the Start Search, type in "env"
2. Choose the "Edit the system environment variables"
3. Click the "Environment Variables…" button
4. Under the "User variables for <YOUR_USERNAME>" section (the upper half)
5. Click the "New..." button
6. Choose the "Variable name" input bar, type in "GOPROXY"
7. Choose the "Variable value" input bar, type in "http://localhost:8080"
8. Click the "OK" button

done.

Community

If you want to discuss Goproxy, or ask questions about it, simply post questions or ideas here.

Contributing

If you want to help build Goproxy, simply follow this to send pull requests here.

License

This project is licensed under the Unlicense.

License can be found here.