fix: improve VLESS link compatibility and add Reality repair script
Only encode SNI dots, keep pbk/sid raw, copy links via API, prefer xray keygen, and add repair-reality.sh for server-side fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -18,13 +18,13 @@ done
|
||||
mkdir -p "$OUT_DIR"
|
||||
|
||||
urlencode() {
|
||||
python3 -c "import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1], safe='').replace('.', '%2E'))" "$1"
|
||||
python3 -c "import sys; print(sys.argv[1].replace('.', '%2E'))" "$1"
|
||||
}
|
||||
|
||||
REALITY_SNI_ENC="$(urlencode "$REALITY_SERVER_NAME")"
|
||||
REALITY_PBK_ENC="$(urlencode "$REALITY_PUBLIC_KEY")"
|
||||
REALITY_SID_ENC="$(urlencode "$REALITY_SHORT_ID")"
|
||||
HY2_PASSWORD_ENC="$(urlencode "$HY2_PASSWORD")"
|
||||
REALITY_PBK_ENC="$REALITY_PUBLIC_KEY"
|
||||
REALITY_SID_ENC="$REALITY_SHORT_ID"
|
||||
HY2_PASSWORD_ENC="$(python3 -c "import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1], safe=''))" "$HY2_PASSWORD")"
|
||||
DOMAIN_SNI_ENC="$(urlencode "$DOMAIN")"
|
||||
|
||||
sed -e "s|\${VPS_IP}|${VPS_IP}|g" \
|
||||
@@ -38,7 +38,7 @@ sed -e "s|\${VPS_IP}|${VPS_IP}|g" \
|
||||
|
||||
cat > "$OUT_DIR/share-links.txt" <<EOF
|
||||
========== VLESS + Reality (主力) ==========
|
||||
vless://${UUID}@${VPS_IP}:443?encryption=none&flow=xtls-rprx-vision&security=reality&sni=${REALITY_SNI_ENC}&fp=chrome&pbk=${REALITY_PBK_ENC}&sid=${REALITY_SID_ENC}&spx=%2F&type=tcp#Reality-Main
|
||||
vless://${UUID}@${VPS_IP}:443?type=tcp&security=reality&encryption=none&flow=xtls-rprx-vision&sni=${REALITY_SNI_ENC}&fp=chrome&pbk=${REALITY_PBK_ENC}&sid=${REALITY_SID_ENC}&spx=%2F#Reality-Main
|
||||
|
||||
========== Hysteria2 (备用) ==========
|
||||
hy2://${HY2_PASSWORD_ENC}@${DOMAIN}:8443?sni=${DOMAIN_SNI_ENC}#Hysteria2-Backup
|
||||
|
||||
Reference in New Issue
Block a user