Easy to use reverse proxy with docker integration
Find a file
2024-11-03 23:45:23 +08:00
.github/workflows improved idlewatcher and content type matching, update CI 2024-10-07 17:41:08 +08:00
.trunk correcting some behaviors for $DOCKER_HOST, now uses container's private IP instead of localhost 2024-10-11 09:13:38 +08:00
.vscode fixed event name missing 2024-10-04 06:51:26 +08:00
cmd correcting startup behavior 2024-11-02 03:00:14 +08:00
examples/error_pages fixed wrong closing tag in example error page 2024-11-03 23:45:23 +08:00
internal added predefined homepage categories 2024-11-03 11:44:30 +08:00
pkg added package version api, dependencies upgrade 2024-10-06 09:23:41 +08:00
schema initial gotify support 2024-10-22 05:38:09 +08:00
screenshots fixed idlewatcher panics and incorrect behavior, update screenshot 2024-10-06 16:17:52 +08:00
scripts added package version api, dependencies upgrade 2024-10-06 09:23:41 +08:00
.env.example moved env to .env.example, update setup method 2024-11-02 03:36:55 +08:00
.gitignore added example error pages, removed compose examples 2024-11-03 09:56:47 +08:00
.gitlab-ci.yml added package version api, dependencies upgrade 2024-10-06 09:23:41 +08:00
.gitmodules refactor file names, readme updates, removed frontend submodule as it is being built independently 2024-09-25 11:22:25 +08:00
.golangci.yml refactor and typo fixes 2024-11-02 03:14:47 +08:00
compose.example.yml removed default values 2024-11-03 07:34:16 +08:00
config.example.yml added explicit only mode for docker provider, updated dependencies 2024-09-29 11:24:41 +08:00
Dockerfile refactored http import name, fixed and simplified idlewatcher/idlewaker implementation, dependencies update 2024-10-07 12:45:07 +08:00
go.mod removed unnecessary pointer indirection, added rate limiter middleware 2024-11-03 07:07:30 +08:00
go.sum implemented login and jwt auth 2024-10-30 06:25:32 +08:00
LICENSE added license 2024-04-01 04:08:48 +00:00
Makefile removed unnecessary pointer indirection, added rate limiter middleware 2024-11-03 07:07:30 +08:00
providers.example.yml readme updates, docs moved to wiki 2024-10-04 11:27:11 +08:00
README.md readme indentation 2024-11-03 04:50:40 +08:00
README_CHT.md readme updates, docs moved to wiki 2024-10-04 11:27:11 +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 and dashboard.

Screenshot

Join our Discord for help and discussions

Table of content

Key Features

  • Easy to use
    • Effortless configuration
    • Simple multi-node setup
    • Error messages is clear and detailed, easy troubleshooting
  • Auto SSL cert management (See Supported DNS-01 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 screenshots)
  • HTTP(s) reserve proxy
  • HTTP middleware support
  • Custom error pages support
  • TCP and UDP port forwarding
  • Web UI with App dashboard
  • Supports linux/amd64, linux/arm64
  • 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, or set up manually

    docker run --rm -v .:/setup ghcr.io/yusing/go-proxy /app/go-proxy setup
    # Then set the JWT secret
    sed -i "s|GOPROXY_API_JWT_SECRET=.*|GOPROXY_API_JWT_SECRET=$(openssl rand -base64 32)|g" .env
    
  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 Multi docker nodes setup) and then them inside config.yml

  5. Run go-proxy docker compose up -d then list all routes to see if further configurations are needed: docker exec go-proxy /app/go-proxy ls-routes

  6. You may now do some extra configuration

    • With text editor (e.g. Visual Studio Code)
    • With Web UI via http://localhost:3000 or https://gp.y.z
    • For more info, See Wiki

🔼Back to top

Manual Setup

  1. Make config directory then grab config.example.yml into config/config.yml

    mkdir -p config && wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/config.example.yml -O config/config.yml

  2. Grab .env.example into .env

    wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/.env.example -O .env

  3. Grab compose.example.yml into compose.yml

    wget https://raw.githubusercontent.com/yusing/go-proxy/v0.7/compose.example.yml -O compose.yml

  4. Set the JWT secret

    sed -i "s|GOPROXY_API_JWT_SECRET=.*|GOPROXY_API_JWT_SECRET=$(openssl rand -base64 32)|g" .env

  5. Start the container docker compose up -d

Folder structrue

├── certs
│   ├── cert.crt
│   └── priv.key
├── compose.yml
├── config
│   ├── config.yml
│   ├── middlewares
│   │   ├── middleware1.yml
│   │   ├── middleware2.yml
│   ├── provider1.yml
│   └── provider2.yml
└── .env

Use JSON Schema in VSCode

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

🔼Back to top

Screenshots

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