Files
jiedian/scripts/migrate-xray-reality.sh
T
dekun c9895133cb fix: run VLESS Reality on Xray instead of sing-box for v2rayN
sing-box Hy2 stays on 8443+; port 443 VLESS uses Xray which pairs reliably with v2rayN/Xray-core clients.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 11:56:22 +08:00

31 lines
939 B
Bash
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.
#!/usr/bin/env bash
# 已有 VPS:将 VLESS Reality 从 sing-box 迁移到 Xray443
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
[[ $EUID -eq 0 ]] || { echo "请使用 root 运行"; exit 1; }
if ! command -v xray &>/dev/null; then
echo "[+] 安装 Xray ..."
bash -c "$(curl -fsSL https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
fi
export JIEDIAN_ROOT="$ROOT_DIR"
echo "[+] 更新 sing-box 配置(仅 Hysteria2..."
python3 "$ROOT_DIR/scripts/render-server.py"
echo "[+] 生成 Xray 配置(VLESS Reality 443..."
python3 "$ROOT_DIR/scripts/render-xray.py"
systemctl enable xray 2>/dev/null || true
systemctl restart xray sing-box jiedian-panel
echo ""
echo "[+] 迁移完成。请运行诊断:"
bash "$ROOT_DIR/scripts/verify-reality.sh"
echo ""
echo "客户端无需改参数,直接测速 VLESS 节点即可。"