Easy to use reverse proxy with docker integration
Find a file
2024-09-27 00:34:14 +08:00
.github/workflows Initial abstract implementation of middlewares 2024-09-25 14:12:40 +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 Update docker.md 2024-09-26 22:52:56 +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
schema support '0' listening port, readme update, showcase added 2024-09-23 04:09:56 +08:00
showcase support '0' listening port, readme update, showcase added 2024-09-23 04:09:56 +08:00
src changing alias index prefix from '$' to '#', to avoid unquoted/unescaped dollar sign being treated as interpolation 2024-09-27 00:34:14 +08:00
.gitignore refactor file names, readme updates, removed frontend submodule as it is being built independently 2024-09-25 11:22:25 +08:00
.gitlab-ci.yml Dev 2024-04-08 05:07:27 +00:00
.gitmodules refactor file names, readme updates, removed frontend submodule as it is being built independently 2024-09-25 11:22:25 +08:00
compose.example.yml Update compose.example.yml 2024-09-21 16:07:12 +08:00
config.example.yml Update config.example.yml 2024-09-26 22:51:29 +08:00
Dockerfile github ci fix attempt, speedup docker build on CI 2024-09-25 10:46:45 +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 Refactoring 2024-09-25 03:43:47 +08:00
providers.example.yml example fix 2024-09-24 03:13:39 +08:00
README.md added discord invite badge 2024-09-27 00:23:46 +08:00
README_CHT.md added discord invite badge 2024-09-27 00:23:46 +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
    • Simple multi-node setup
    • Error messages is clear and detailed, easy troubleshooting
  • Auto SSL cert management (See Supported DNS Challenge Providers)
  • Auto configuration for docker containers
  • Auto hot-reload on container state / config file changes
  • idlesleeper: stop containers on idle, wake it up on traffic (optional, see showcase)
  • HTTP(s) reserve proxy
  • TCP and UDP port forwarding
  • Web UI for configuration and monitoring (See screenshots)
  • Supports linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6 multi-platform
  • Written in Go

🔼Back to top

Getting Started

Setup

  1. Pull docker image

    docker pull ghcr.io/yusing/go-proxy:latest
    
  2. Create new directory, cd into it, then run setup

    docker run --rm -v .:/setup ghcr.io/yusing/go-proxy /app/go-proxy setup
    
  3. Setup DNS Records point to machine which runs go-proxy, e.g.

    • A Record: *.y.z -> 10.0.10.1
    • AAAA Record: *.y.z -> ::ffff:a00:a01
  4. Setup docker-socket-proxy other docker nodes (if any) (see example) and then them inside config.yml

  5. Done. You may now do some extra configuration

    • With text editor (e.g. Visual Studio Code)
    • With Web UI via gp.y.z
    • For more info, See docker.md

🔼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 go-proxy /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

🔼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

Include Files

These are files that include standalone proxy entries

See Fields

See providers.example.yml for examples

🔼Back to top

Showcase

idlesleeper

idlesleeper

🔼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