A secure HTTP/HTTPS proxy server in Go with Basic authentication, TLS support, and upstream proxy chaining.
- HTTP and HTTPS proxy modes
- Basic authentication
- TLS with configurable certificates
- Upstream proxy chaining (proxy chain support)
- Supports HTTP and HTTPS upstream proxies
- Configurable via
config.yamlor environment variables (HTTPS_PROXY,HTTP_PROXY) - Basic authentication to upstream proxy
- Configurable via YAML file
- Systemd service support
- Graceful shutdown
Download the latest binary from the Releases page.
-
Clone the repository:
git clone https://github.com/hightemp/https_proxy cd https_proxy -
Build the project:
make build
Create a config.yaml file (see config.example.yaml):
proxy_addr: 0.0.0.0:8080
username: "your_username"
password: "your_password"
proto: https
cert_path: "path/to/your/cert.pem"
key_path: "path/to/your/key.pem"
# upstream_proxy: http://user:pass@upstream-proxy:8080| Parameter | Description |
|---|---|
proxy_addr |
Listen address and port |
username |
Basic auth username |
password |
Basic auth password |
proto |
http or https |
cert_path |
Path to TLS certificate (for https mode) |
key_path |
Path to TLS private key (for https mode) |
upstream_proxy |
Upstream proxy URL for chaining (optional) |
To route all traffic through an upstream proxy, set upstream_proxy in config.yaml:
upstream_proxy: http://user:pass@upstream-proxy:8080HTTPS upstream proxies are also supported:
upstream_proxy: https://user:pass@upstream-proxy:8443If upstream_proxy is not set in the config, the proxy falls back to standard environment variables (HTTPS_PROXY, HTTP_PROXY, NO_PROXY).
Generate self-signed certificates:
bash generate_certs.shOr use Let's Encrypt:
sudo certbot certonly --standalone -d example.comcert_path: "/etc/letsencrypt/live/example.com/fullchain.pem"
key_path: "/etc/letsencrypt/live/example.com/privkey.pem"./https_proxy -config config.yamlsudo make installManage the service:
make start / stop / restart / status| Command | Description |
|---|---|
make build |
Build the binary |
make build-static |
Build a static binary (linux/amd64) |
make run |
Run the proxy |
make install |
Install binary, config and systemd service |
make uninstall |
Remove binary and service (keep config) |
make uninstall-full |
Remove everything including config |
make release |
Tag version from VERSION file and push |
-
Update the version in the
VERSIONfile. -
Run:
make release
This will commit, create a git tag
vX.Y.Z, and push it. GitHub Actions will automatically build binaries and create a release.
This project is licensed under the MIT License.