https://github.com/moeshinx/relay-panel
Self-hosted TCP/UDP forwarding management panel with relay-node, WebSocket control, quotas, and traffic stats.
https://github.com/moeshinx/relay-panel
panel relay rust self-hosted tcp-forwarding udp-forwarding webui
Last synced: about 11 hours ago
JSON representation
Self-hosted TCP/UDP forwarding management panel with relay-node, WebSocket control, quotas, and traffic stats.
- Host: GitHub
- URL: https://github.com/moeshinx/relay-panel
- Owner: MoeShinX
- License: agpl-3.0
- Created: 2026-06-25T10:45:42.000Z (7 days ago)
- Default Branch: main
- Last Pushed: 2026-07-02T11:10:03.000Z (about 11 hours ago)
- Last Synced: 2026-07-02T12:00:14.826Z (about 11 hours ago)
- Topics: panel, relay, rust, self-hosted, tcp-forwarding, udp-forwarding, webui
- Language: Rust
- Homepage: https://relaypanel.dev
- Size: 1.46 MB
- Stars: 60
- Watchers: 0
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.en.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Roadmap: docs/ROADMAP-v0.4.md
Awesome Lists containing this project
README
RelayPanel
⚡ Self-hosted TCP/UDP Forwarding Management Panel ⚡
English | 中文
Built with Rust. Manage forwarding rules, device groups, traffic quotas, and
live node status via web UI. Lightweight: Panel ~7 MB + Node ~4 MB.
Deploy: Docker Compose. Database: SQLite / PostgreSQL.
---
## ✨ Features
- 🔀 **Forwarding rules** — TCP/UDP port forwarding with multi-target, failover and round-robin load balancing; on Linux, unlimited rules use `splice` zero-copy forwarding for low latency and jitter on long chains
- 🛡️ **Circuit breaker** — a target that keeps failing is skipped for a while; all-down triggers probe mode for auto-recovery
- 🛒 **Plan shop & billing** — self-service purchase (balance charge) with order history; admin plan CRUD, plans grant lines and auto-authorize on purchase
- 💳 **Up + down billing + per-line rate** — charged as `(upload + download) × line rate (0.1–100)` against the plan quota
- 🔁 **Single current plan** — one plan per user: buying the **same** plan renews it (stack traffic / extend a time plan), buying a **different** plan switches (full replace, with a confirm); rules on lost lines auto-pause and auto-resume once re-authorized
- 📈 **Traffic & quotas** — per-rule and per-user tracking with configurable limits (rule count, bandwidth, traffic cap)
- 📋 **Multi-plan registration** — admins configure allowed plans; users choose on sign-up
- 👤 **User management** — manage any user's rules, plan (assign / renew / switch / expiry / remove), reset traffic, reset password, ban/unban
- 🖥️ **Device group management** — expandable groups with node listings; a "hidden" toggle hides a group from regular users' Node Status page only (rules keep working); node removal does not affect groups or rules
- ⬆️ **One-click node upgrade** — trigger from the panel; the node self-updates from the official release (sha256-verified, upgrade-only never downgrade, aware of systemd / docker / manual installs); node ships native amd64 / arm64 binaries
- 🖱️ **Minimal rule import/export** — single-line JSON format, batch import / batch pause-resume with automatic node distribution
- 🖥️ **Live node status** — CPU, memory, connections, node version (highlighted when an upgrade is available)
- 🌍 **Node region detection** — automatically identifies each node's country/region with flag display
- 🗄️ **Dual database** — SQLite (default, zero-config) or PostgreSQL
- 🔒 **Security** — first login forces password change; node auth via Bearer token
---
## 🏗️ Architecture
```
Browser (React UI) relay-node (Tokio TCP/UDP)
│ ▲
▼ │
relay-panel ◄─── WebSocket config push + HTTP status report
(Axum API) │
│ ▼
SQLite / PG forwards traffic to targets
```
---
## 🚀 Quick start
**One command deploy:**
```bash
curl -fsSL https://raw.githubusercontent.com/MoeShinX/relay-panel/main/install.sh | bash
```
> 🔑 **Default login `admin` / `admin123` — first login forces a password change.**
📖 Full guide: **[docs/DEPLOYMENT.md](docs/DEPLOYMENT.md)**
---
## 🔄 Update
```bash
cd /opt/relay-panel && git pull --quiet && ./deploy.sh
```
> ⚠️ Back up `.env` and your database before updating.
Forwarding nodes: **Device Groups → Copy Install Command** → paste on the node.
---
## 🛠️ Local dev
```bash
cargo build && cargo run -p relay-panel & # API on :18888
cd frontend && npm install && npm run dev # UI on :5173
python3 tests/e2e_test.py # end-to-end test
```
---
## 📦 Tech stack
| Layer | Choice |
|-------|--------|
| Backend | Rust · Axum 0.8 · Tokio · sqlx |
| Database | SQLite / PostgreSQL |
| Auth | JWT · bcrypt |
| Forward | Tokio async TCP + UDP |
| Frontend | React 19 · TypeScript · Ant Design |
| Deploy | Docker multi-stage · Compose |
---
## 📄 License & Disclaimer
AGPL-3.0 — see [LICENSE](LICENSE).
Open-source traffic-forwarding tool for **personal study and research only**.
Use lawfully and at your own risk.
Full **[Disclaimer](docs/DISCLAIMER.md)**