XBoard + Soga + Xray/XrayR 搭建一个完整的多用户代理系统
XBoard + Soga + Xray/XrayR 结合使用,搭建一个完整的多用户代理系统,实现对接 XBoard 面板、用户认证、转发代理、按流量控制等功能。
✅ 一、组件职责简述
组件 | 作用 |
---|---|
XBoard | 用户管理系统(前后端),用户注册、充值、流量监控、套餐订阅等。 |
Soga | 对接 XBoard 的中间层,连接数据库并管理 Xray 的运行配置。 |
Xray/XrayR | 实际跑代理服务(如 VLESS、VMess、Trojan),处理转发请求和 TLS。 |
✅ 二、架构图(逻辑)
┌──────────┐
│ XBoard │ ← 用户管理前后端(订阅、流量统计)
└────┬─────┘
│
数据库/API 对接(MySQL)
│
┌────▼────┐
│ Soga │ ← 后台守护进程,读取数据库配置生成 Xray 配置
└────┬────┘
│
生成配置并管理进程(vmess/vless/trojan等)
│
┌────▼────┐
│ Xray/R │ ← 实际代理服务器
└─────────┘
Xboard is a modern panel system built on Laravel 11, focusing on providing a clean and efficient user experience.
✨ Features
- 🚀 Built with Laravel 11 + Octane for significant performance gains
- 🎨 Redesigned admin interface (React + Shadcn UI)
- 📱 Modern user frontend (Vue3 + TypeScript)
- 🐳 Ready-to-use Docker deployment solution
- 🎯 Optimized system architecture for better maintainability
🚀 Quick Start
git clone -b compose --depth 1 https://github.com/cedar2025/Xboard && \
cd Xboard && \
docker compose run -it --rm \
-e ENABLE_SQLITE=true \
-e ENABLE_REDIS=true \
-e ADMIN_ACCOUNT=admin@demo.com \
web php artisan xboard:install && \
docker compose up -d
After installation, visit: http://SERVER_IP:7001
⚠️ Make sure to save the admin credentials shown during installation
✅ 三、你当前部署方式建议
既然你已部署好 XBoard,可以按照以下顺序继续:
1️⃣ 部署数据库(MySQL)
确保 XBoard 已正确连接数据库(MySQL)
记住数据库的地址、用户名、密码、端口(供 Soga 使用)
2️⃣ 安装并配置 Soga
bash <(curl -Ls https://raw.githubusercontent.com/sprov065/soga/master/install.sh)
安装完成后:
nano /etc/soga/soga.conf
配置重点字段如下:
type=mysql
api_interface=webapi
webapi_url=https://你的XBoard域名
webapi_key=你的面板通信密钥(XBoard后台中获取)
webapi_port=3306
webapi_mysql_user=你的数据库用户名
webapi_mysql_pass=数据库密码
webapi_mysql_db=xboard数据库名
node_id=1 # 对应面板中添加的节点编号
run_mode=multi_user
xray_bin_path=/usr/local/bin/xray
配置好后启动:
systemctl start soga
systemctl enable soga
可以用 tail -f /etc/soga/soga.log
查看运行日志。
3️⃣ 部署并启动 Xray/XrayR
Soga 会自动调用你配置的 Xray 路径(如 /usr/local/bin/xray
),你只需确保它已正确安装即可。Soga 会自动生成配置并运行。
4️⃣ 在 XBoard 中添加节点
在后台添加节点,注意:
类型:选择 V2ray/Xray
协议:如 VLESS、VMess、Trojan 等
节点 ID 与 soga.conf
中 node_id
对应
【此教程来源于网络,仅供学习,请勿投入正式环境使用】