Easy to use reverse proxy with docker integration
Find a file
2024-09-22 04:13:42 +08:00
.github/workflows github CI fix attempt 2024-09-21 14:32:52 +08:00
.vscode v0.5: (BREAKING) replacing path with path_patterns, improved docker monitoring mechanism, bug fixes 2024-09-16 13:05:04 +08:00
docs added some docker compose examples; fixed defaults to wrong host; updated watcher behavior to retry connection every 3 secs until success or until cancelled 2024-09-22 04:00:08 +08:00
examples added some docker compose examples; fixed defaults to wrong host; updated watcher behavior to retry connection every 3 secs until success or until cancelled 2024-09-22 04:00:08 +08:00
frontend@d0e59630d6 v0.5-rc3: update docker port detect mechanism, docker compose file and doc update 2024-09-17 03:11:04 +08:00
schema v0.5.0-rc4: initial support for ovh, provider generator implementation update, replaced all interface{} to any 2024-09-17 12:06:58 +08:00
src renamed ProxyEntry to RawEntry to avoid confusion with src/proxy/entry.go 2024-09-22 04:13:42 +08:00
.gitignore added some docker compose examples; fixed defaults to wrong host; updated watcher behavior to retry connection every 3 secs until success or until cancelled 2024-09-22 04:00:08 +08:00
.gitlab-ci.yml Dev 2024-04-08 05:07:27 +00:00
.gitmodules v0.5: readme and dockerfile update, removed old panel sources, added new frontend as submodule 2024-08-09 07:03:24 +08:00
compose.example.yml Update compose.example.yml 2024-09-21 16:07:12 +08:00
config.example.yml v0.5: (BREAKING) simplified config format, improved error output, updated proxy entry default value for 'port' 2024-08-14 02:41:11 +08:00
Dockerfile v0.5.0-rc4: fixing autocert issue, cache ACME registration, added ls-config option 2024-09-17 08:41:36 +08:00
go.work v0.5.0-rc4: initial support for ovh, provider generator implementation update, replaced all interface{} to any 2024-09-17 12:06:58 +08:00
LICENSE added license 2024-04-01 04:08:48 +00:00
Makefile check release 2024-09-21 12:45:56 +08:00
providers.example.yml v0.5-rc1: schema fixes, provider file example update 2024-09-16 13:19:24 +08:00
README.md added some docker compose examples; fixed defaults to wrong host; updated watcher behavior to retry connection every 3 secs until success or until cancelled 2024-09-22 04:00:08 +08:00
README_CHT.md 新增繁中README (未完成) 2024-09-19 21:16:38 +08:00
setup-docker.sh update default branch for setup script 2024-09-17 03:54:55 +08:00

go-proxy

Quality Gate Status Lines of Code Security Rating Maintainability Rating Vulnerabilities

繁體中文文檔請看此

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

🔼Back to top

Getting Started

Setup

  1. Setup DNS Records, e.g.

    • A Record: *.y.z -> 10.0.10.1
    • AAAA Record: *.y.z -> ::ffff:a00:a01
  2. Setup go-proxy See here

  3. Setup docker-socket-proxy (see example other machine that is running docker (if any)

  4. Configure go-proxy

    • with text editor (e.g. Visual Studio Code)
    • or with web config editor via http://gp.y.z

🔼Back to top

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_PORT http server port 80 integer
GOPROXY_HTTPS_PORT http server port (if enabled) 443 integer
GOPROXY_API_PORT api server port 8888 integer

Use JSON Schema in VSCode

Copy .vscode/settings.example.json to .vscode/settings.json and modify it to fit your needs

🔼Back to top

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

🔼Back to top

Provider File

See Fields

See providers.example.yml for examples

🔼Back to top

Known issues

  • Cert "renewal" is actually obtaining a new cert instead of renewing the existing one

  • autocert config is not hot-reloadable

🔼Back to top

Build it yourself

  1. Clone the repository git clone https://github.com/yusing/go-proxy --depth=1

  2. Install / Upgrade go (>=1.22) and make if not already

  3. Clear cache if you have built this before (go < 1.22) with go clean -cache

  4. get dependencies with make get

  5. build binary with make build

🔼Back to top