feat: новый VLESS сервер + поддержка tcp/vision flow
- Добавлен сервер 202.148.54.122 (AmneziaVPN) с flow=xtls-rprx-vision - Парсер VLESS URL: автоопределение типа транспорта (xhttp/tcp) - Если flow указан → тип по умолчанию tcp - Если flow пустой → тип по умолчанию xhttp - Генератор конфига: xhttpSettings только для xhttp-транспорта - Поле flow в users теперь берётся из URL (ранее было пустым) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
23
ai-setup.sh
23
ai-setup.sh
@@ -59,16 +59,22 @@ def get(p, default=''):
|
||||
vals = params.get(p, [default])
|
||||
return vals[0] if vals else default
|
||||
|
||||
flow = get('flow')
|
||||
vtype = get('type')
|
||||
if not vtype:
|
||||
vtype = 'xhttp' if not flow else 'tcp'
|
||||
|
||||
print(f'VL_UUID={uuid}')
|
||||
print(f'VL_ADDRESS={host}')
|
||||
print(f'VL_PORT={port}')
|
||||
print(f'VL_ENCRYPTION={get(\"encryption\")}')
|
||||
print(f'VL_FLOW={flow}')
|
||||
print(f'VL_SECURITY={get(\"security\")}')
|
||||
print(f'VL_SNI={get(\"sni\")}')
|
||||
print(f'VL_FP={get(\"fp\", \"chrome\")}')
|
||||
print(f'VL_PBK={get(\"pbk\")}')
|
||||
print(f'VL_SID={get(\"sid\")}')
|
||||
print(f'VL_TYPE={get(\"type\", \"xhttp\")}')
|
||||
print(f'VL_TYPE={vtype}')
|
||||
print(f'VL_PATH={urllib.parse.unquote(get(\"path\", \"/\"))}')
|
||||
print(f'VL_MODE={get(\"mode\", \"auto\")}')
|
||||
print(f'VL_NAME={name}')
|
||||
@@ -223,6 +229,13 @@ if [ "$USE_VLESS" -eq 1 ]; then
|
||||
rm -rf "$TMPDIR"
|
||||
|
||||
sudo mkdir -p /etc/xray
|
||||
|
||||
# xhttpSettings — только для xhttp-транспорта
|
||||
_VL_XHTTP=""
|
||||
if [ "$VL_TYPE" = "xhttp" ]; then
|
||||
_VL_XHTTP=$(printf ',\n "xhttpSettings": {\n "path": "%s",\n "mode": "%s"\n }' "$VL_PATH" "$VL_MODE")
|
||||
fi
|
||||
|
||||
sudo tee /etc/xray/config.json > /dev/null << XRAYEOF
|
||||
{
|
||||
"log": { "loglevel": "warning" },
|
||||
@@ -251,7 +264,7 @@ if [ "$USE_VLESS" -eq 1 ]; then
|
||||
{
|
||||
"id": "$VL_UUID",
|
||||
"encryption": "$VL_ENCRYPTION",
|
||||
"flow": ""
|
||||
"flow": "$VL_FLOW"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -265,11 +278,7 @@ if [ "$USE_VLESS" -eq 1 ]; then
|
||||
"fingerprint": "$VL_FP",
|
||||
"publicKey": "$VL_PBK",
|
||||
"shortId": "$VL_SID"
|
||||
},
|
||||
"xhttpSettings": {
|
||||
"path": "$VL_PATH",
|
||||
"mode": "$VL_MODE"
|
||||
}
|
||||
}$_VL_XHTTP
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user