A lightweight HTTP proxy server written in Go, supporting domain-based forwarding rules.
- 🚀 High performance proxy server
- 🔍 Domain pattern matching (exact and wildcard)
- ⚙️ YAML configuration file
- 🔒 HTTPS tunneling support
- 📝 Logging with logrus
Edit config.yaml
to define forwarding rules:
rules:
- domainPattern: "*.cn" # Wildcard match
forwardMethod: "direct" # direct or proxy
- domainPattern: "google.com" # Exact match
forwardMethod: "proxy"
- Install Go (1.20+)
- Clone this repository
- Build the project:
go build -o proxy
Start the proxy server:
./proxy -listen :8080 -proxy 127.0.0.1:8079
Default listen address is :8080
The proxy supports two forwarding methods:
direct
: Connect directly to target serverproxy
: Forward through upstream proxy (default: 127.0.0.1:8079) (http protocol)
Logs are written to http_proxy.log
in the current directory.
rules:
- domainPattern: "*.cn"
forwardMethod: "direct"
- domainPattern: "google.com"
forwardMethod: "proxy"
- domainPattern: "*.bilibili.com"
forwardMethod: "direct"
GPLv3