Skip to content

A proxy implementation in Golang support rules control.

Notifications You must be signed in to change notification settings

gluxhappy/go-proxy

Repository files navigation

Go Proxy

An HTTP proxy implementation using Golang, support rules.

Download

prebuilds

Configuration

Example configuration can be:

# Example config filehost: 127.0.0.1port: 18888geo: GeoLite2-Country.mmdb # default: GeoLite2-Country.mmdb, path to GeoLite2-Country.mmdballow-localhost: false # default: false, true to allow access to the localhost and loopback addressesssl-ports: [443, 8443] # default: [443, 8443], safe ports for HTTP CONNECTproxies: fiddler: http://127.0.0.1:8888clash: http://127.0.0.1:33210default: DIRECT # DENY, default proxy for unmatched requestsrules: - name: "cn"type: "DOMAIN-SUFFIX"match: ".cn"proxy: "DIRECT"# DENY - name: "google"type: "WILDCARD"match: "*.youtube.com"proxy: "fiddler" - name: "google"type: "REGEXP"match: ".*google.*"proxy: "clash" - name: "external"type: "GEOIP"match: "!CN"proxy: "clash"

Build

Build with docker on Windows

rem Build for Linux amd64 docker run -it --rm -v %CD%:/code -e GOOS=linux -e GOARCH=amd64 -w /code golang:1.21.5 go build -buildvcs=false -o go-proxy-linux-amd64 rem Build for Linux amd64 docker run -it --rm -v %CD%:/code -e GOOS=linux -e GOARCH=arm64 -w /code golang:1.21.5 go build -buildvcs=false -o go-proxy-linux-arm64 rem Build for Windows docker run -it --rm -v %CD%:/code -e GOOS=windows -e GOARCH=amd64 -w /code golang:1.21.5 go build -buildvcs=false -o go-proxy-windows-amd64.exe

Build with docker on Linux

# Build for Linux amd64 docker run -it --rm -v $(pwd):/code -e GOOS=linux -e GOARCH=amd64 -w /code golang:1.21.5 go build -buildvcs=false -o go-proxy-linux-amd64 # Build for Linux amd64 docker run -it --rm -v $(pwd):/code -e GOOS=linux -e GOARCH=arm64 -w /code golang:1.21.5 go build -buildvcs=false -o go-proxy-linux-arm64 # Build for Windows docker run -it --rm -v $(pwd):/code -e GOOS=windows -e GOARCH=amd64 -w /code golang:1.21.5 go build -buildvcs=false -o go-proxy-windows-amd64.exe

About

A proxy implementation in Golang support rules control.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages