mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
5.4 KiB
Executable file
5.4 KiB
Executable file
go-proxy
A lightweight, easy-to-use, and performant reverse proxy with a web UI.
Table of content
Key Points
- Easy to use
- Effortless configuration
- Error messages is clear and detailed, easy troubleshooting
- Auto certificate obtaining and renewal (See Supported DNS Challenge Providers)
- Auto configuration for docker containers
- Auto hot-reload on container state / config file changes
- Stop containers on idle, wake it up on traffic (optional)
- HTTP(s) reserve proxy
- TCP and UDP port forwarding
- Web UI for configuration and monitoring (See screenshots)
- Written in Go
Getting Started
Setup
-
Setup DNS Records, e.g.
- A Record:
*.y.z
->10.0.10.1
- AAAA Record:
*.y.z
->::ffff:a00:a01
- A Record:
-
Setup
go-proxy
See here -
Setup
docker-socket-proxy
(see example other machine that is running docker (if any) -
Configure
go-proxy
- with text editor (e.g. Visual Studio Code)
- or with web config editor via
http://gp.y.z
Commands line arguments
Argument | Description | Example |
---|---|---|
empty | start proxy server | |
validate |
validate config and exit | |
reload |
trigger a force reload of config | |
ls-config |
list config and exit | go-proxy ls-config | jq |
ls-route |
list proxy entries and exit | go-proxy ls-route | jq |
run with docker exec <container_name> /app/go-proxy <command>
Environment variables
Environment Variable | Description | Default | Values |
---|---|---|---|
GOPROXY_NO_SCHEMA_VALIDATION |
disable schema validation | false |
boolean |
GOPROXY_DEBUG |
enable debug behaviors | false |
boolean |
GOPROXY_HTTP_ADDR |
http server listening address | :80 |
[host]:port |
GOPROXY_HTTPS_ADDR |
https server listening address (if enabled) | :443 |
[host]:port |
GOPROXY_API_ADDR |
api server listening address | 127.0.0.1:8888 |
[host]:port |
Use JSON Schema in VSCode
Copy .vscode/settings.example.json
to .vscode/settings.json
and modify it to fit your needs
Config File
See config.example.yml for more
# autocert configuration
autocert:
email: # ACME Email
domains: # a list of domains for cert registration
provider: # DNS Challenge provider
options: # provider specific options
- ...
# reverse proxy providers configuration
providers:
include:
- providers.yml
- other_file_1.yml
- ...
docker:
local: $DOCKER_HOST
remote-1: tcp://10.0.2.1:2375
remote-2: ssh://root:1234@10.0.2.2
Provider File
See Fields
See providers.example.yml for examples
Known issues
autocert
config is not hot-reloadable
Build it yourself
-
Clone the repository
git clone https://github.com/yusing/go-proxy --depth=1
-
Install / Upgrade go (>=1.22) and
make
if not already -
Clear cache if you have built this before (go < 1.22) with
go clean -cache
-
get dependencies with
make get
-
build binary with
make build