Files
jiedian/docs/STACK.md
T
dekun 4b3f6a1de2 docs: update deployment and troubleshooting for Xray + sing-box split
Document new install flow, ports, migration script, and v2rayN Reality settings across README and docs/.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 12:03:03 +08:00

38 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 方案决策记录
## 已确认选型
| 项目 | 选择 | 理由 |
|------|------|------|
| 协议栈 | **VLESS + Reality + Hysteria2 双栈** | Reality 抗主动探测;Hysteria2 作 UDP 备用与流媒体 |
| Reality 服务端 | **Xray** | 与 v2rayN / v2rayNGXray 核心)兼容性最好;sing-box Reality 易出现 `processed invalid connection` |
| Hy2 服务端 | **sing-box** | 原生 Hysteria2、Clash API 统计、多 inbound 按节点分端口 |
| 系统 | **Ubuntu 22.04/24.04** | 脚本基于 apt,其他发行版需手动适配 |
| 面板 | **Flask Web 面板** | 添加/删除节点、复制链接、在线与流量统计 |
## 端口规划
| 端口 | 协议 | 服务 | 用途 |
|------|------|------|------|
| 443 | TCP | **Xray** | VLESS + Reality(主力) |
| 84438499 | UDP | **sing-box** | Hysteria2(每节点递增:8443、8444…) |
| 80 | TCP | nginx | ACME 验证 + 管理面板反向代理 |
| 127.0.0.1:5080 | TCP | Flask | 面板后端(不对外暴露) |
| 127.0.0.1:9090 | TCP | sing-box | Clash API(面板统计 Hy2 |
## 配置生成
| 脚本 | 输出 | 内容 |
|------|------|------|
| `render-xray.py` | `/usr/local/etc/xray/config.json` | 所有启用节点的 VLESS UUID + Reality |
| `render-server.py` | `/etc/sing-box/config.json` | 每节点独立 Hy2 inbound + Clash API |
增删节点或轮换 Reality 密钥后,两个脚本都需重新运行并 `systemctl restart xray sing-box`
## 单协议简化
- **仅 Reality**:删除 `render-server.py` 中 Hy2 inbound 逻辑,跳过 acme 证书步骤(需改代码)。
- **仅 Hy2**:不安装 Xray,删除 443 inbound(不推荐,失去 TCP 主力)。
当前默认 **双栈**,与 README / DEPLOY 一致。