fix: use plain SNI in share links for v2rayNG import
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+2
-2
@@ -22,8 +22,8 @@ def load_env() -> dict[str, str]:
|
||||
|
||||
|
||||
def _sni_qs(value: str) -> str:
|
||||
"""Encode dots in SNI; some clients misparsed sni=www.microsoft.com."""
|
||||
return value.replace(".", "%2E")
|
||||
"""SNI in share links — use plain domain; clients decode URL themselves."""
|
||||
return value
|
||||
|
||||
|
||||
def build_links(node: dict, env: dict | None = None) -> dict[str, str | dict[str, str]]:
|
||||
|
||||
@@ -17,15 +17,15 @@ done
|
||||
|
||||
mkdir -p "$OUT_DIR"
|
||||
|
||||
urlencode() {
|
||||
python3 -c "import sys; print(sys.argv[1].replace('.', '%2E'))" "$1"
|
||||
urlencode_sni() {
|
||||
python3 -c "import sys; print(sys.argv[1])" "$1"
|
||||
}
|
||||
|
||||
REALITY_SNI_ENC="$(urlencode "$REALITY_SERVER_NAME")"
|
||||
REALITY_SNI_ENC="$(urlencode_sni "$REALITY_SERVER_NAME")"
|
||||
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")"
|
||||
DOMAIN_SNI_ENC="$(urlencode_sni "$DOMAIN")"
|
||||
|
||||
sed -e "s|\${VPS_IP}|${VPS_IP}|g" \
|
||||
-e "s|\${DOMAIN}|${DOMAIN}|g" \
|
||||
|
||||
Reference in New Issue
Block a user