mirror of
https://github.com/fscarmen/sing-box.git
synced 2026-09-02 13:46:36 +00:00
v1.3.23 fix: force HTTP/2 transport for cloudflared tunnels
- add --protocol http2 to all cloudflared run commands (quick, token, config modes) v1.3.23 fix: cloudflared 隧道统一使用 HTTP/2 传输 - 所有 cloudflared 启动命令(临时 / token / config)加入 --protocol http2
This commit is contained in:
+5
-5
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# 脚本更新日期 2026.06.27
|
||||
# 脚本更新日期 2026.08.14
|
||||
set -e
|
||||
|
||||
WORK_DIR=/sing-box
|
||||
@@ -843,7 +843,7 @@ EOF
|
||||
|
||||
# 根据ARGO_JSON或ARGO_TOKEN设置ARGO_RUNS
|
||||
if [[ -n "$ARGO_JSON" ]]; then
|
||||
local ARGO_RUNS="cloudflared tunnel --edge-ip-version auto --config ${WORK_DIR}/tunnel.yml run"
|
||||
local ARGO_RUNS="cloudflared tunnel --edge-ip-version auto --protocol http2 --config ${WORK_DIR}/tunnel.yml run"
|
||||
echo $ARGO_JSON > ${WORK_DIR}/tunnel.json
|
||||
cat > ${WORK_DIR}/tunnel.yml << EOF
|
||||
tunnel: $(cut -d\" -f12 <<< $ARGO_JSON)
|
||||
@@ -855,12 +855,12 @@ ingress:
|
||||
- service: http_status:404
|
||||
EOF
|
||||
elif [[ -n "$ARGO_TOKEN" ]]; then
|
||||
local ARGO_RUNS="cloudflared tunnel --edge-ip-version auto run --token ${ARGO_TOKEN}"
|
||||
local ARGO_RUNS="cloudflared tunnel --edge-ip-version auto --protocol http2 run --token ${ARGO_TOKEN}"
|
||||
fi
|
||||
else
|
||||
((PORT++))
|
||||
METRICS_PORT=$PORT
|
||||
local ARGO_RUNS="cloudflared tunnel --edge-ip-version auto --no-autoupdate --no-tls-verify --metrics 0.0.0.0:$METRICS_PORT --url http://localhost:$START_PORT"
|
||||
local ARGO_RUNS="cloudflared tunnel --edge-ip-version auto --protocol http2 --no-autoupdate --no-tls-verify --metrics 0.0.0.0:$METRICS_PORT --url http://localhost:$START_PORT"
|
||||
fi
|
||||
|
||||
# 生成 s6-overlay 服务脚本(替代 supervisord)
|
||||
@@ -1460,4 +1460,4 @@ case "$ACTION" in
|
||||
install
|
||||
# 用 s6-overlay 作为 PID 1 承载守护
|
||||
exec /init
|
||||
esac
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user