mirror of
https://github.com/fscarmen/sing-box.git
synced 2026-08-10 17:55:16 +08:00
v1.3.13 feat: add explicit HTTP clients for remote rule sets
* add `http_clients` configuration for sing-box 1.14.0+ * set `route.default_http_client` for remote rule-set downloads * fix: correct Cloudflare API validation logic v1.3.13 feat: 增加远程规则集 HTTP Client 配置 * 为 sing-box 1.14.0+ 增加 `http_clients` 配置 * 为远程规则集下载设置 `route.default_http_client` * fix: 修正 Cloudflare API 判断逻辑
This commit is contained in:
@@ -24,18 +24,21 @@
|
||||
|
||||
* * *
|
||||
## 1.更新信息
|
||||
|
||||
2026.05.18 v1.3.13 Added top-level http_clients configuration; 增加顶层的 http_clients 配置
|
||||
|
||||
2026.05.14 v1.3.12 1. Add Hysteria2 Realm support for machines without public inbound access, with optional WARP-assisted hole punching for strict NAT environments; 2. Realm configuration export is supported for Clash/Mihomo and sing-box clients; 3. Hysteria2 Realm can be enabled or disabled directly via sb -d; 4. Non-interactive installs support --HY2_REALM and --HY2_WARP parameters; 1. 增加 Hysteria2 Realm 支持,适用于没有公网入口的机器,并可选 WARP 辅助打洞; 2. Realm 已支持导出 Clash/Mihomo 和 sing-box 客户端配置; 3. 修改节点配置时可直接开启或关闭 Hysteria2 Realm; 4. 无交互安装支持 --HY2_REALM 与 --HY2_WARP 参数
|
||||
|
||||
2026.05.06 v1.3.11 1. Generate v2rayn:// dedicated links for Tuic subscriptions; 2. Generate v2rayn:// dedicated links for AnyTLS subscriptions; 3. Generate v2rayn:// dedicated links for naive http2 and quic modes. Thanks to @DHR60; 1. 为 Tuic 订阅生成 v2rayn:// 专属链接; 2. 为 AnyTLS 订阅生成 v2rayn:// 专属链接; 3. 为 naive http2 和 quic 模式生成 v2rayn:// 专属链接,感谢 @DHR60
|
||||
|
||||
2026.04.25 v1.3.10 Added native protocol, but client support is extremely limited, with Shadowrocket offering the best compatibility. For the sing-box core, you must use the -glibc or -musl version according to the requirements; refer to the official documentation for details: https://sing-box.sagernet.org/configuration/outbound/naive/; 增加 native 协议,支持该协议的客户端极少,Shadowrocket 支持最好。sing-box 内核需要按说明使用-glibc 或者 -musl 版本,详见官方说明 https://sing-box.sagernet.org/zh/configuration/outbound/naive/
|
||||
|
||||
2026.04.11 v1.3.9 1. remove pre-install UFW blocking logic, fallback to iptables when inactive; 2. avoid unnecessary sing-box restart for CDN / bandwidth / port hopping changes; 3. reduce redundant single-use functions; 1. 移除安装前 UFW 强制校验,inactive 自动回退 iptables; 2. 优选地址 / 带宽 / 端口跳跃修改不再重启 sing-box; 3. 清理单次调用函数,提升结构可读性
|
||||
|
||||
<details>
|
||||
<summary>历史更新 history(点击即可展开或收起)</summary>
|
||||
<br>
|
||||
|
||||
>2026.04.25 v1.3.10 Added native protocol, but client support is extremely limited, with Shadowrocket offering the best compatibility. For the sing-box core, you must use the -glibc or -musl version according to the requirements; refer to the official documentation for details: https://sing-box.sagernet.org/configuration/outbound/naive/; 增加 native 协议,支持该协议的客户端极少,Shadowrocket 支持最好。sing-box 内核需要按说明使用-glibc 或者 -musl 版本,详见官方说明 https://sing-box.sagernet.org/zh/configuration/outbound/naive/
|
||||
>
|
||||
>2026.04.11 v1.3.9 1. remove pre-install UFW blocking logic, fallback to iptables when inactive; 2. avoid unnecessary sing-box restart for CDN / bandwidth / port hopping changes; 3. reduce redundant single-use functions; 1. 移除安装前 UFW 强制校验,inactive 自动回退 iptables; 2. 优选地址 / 带宽 / 端口跳跃修改不再重启 sing-box; 3. 清理单次调用函数,提升结构可读性
|
||||
>
|
||||
>2026.04.10 v1.3.8 1. Automatically detect UFW and switch rule management accordingly; 2. Merge the old -p (port change) functionality into -d (config editor), simplifying usage; 3. Remove the standalone -p / -P entry points entirely; 1. 自动检测 UFW 并切换规则管理方式; 2. 将原有 -p(修改端口)功能合并到 -d(配置修改),简化使用方式; 3. 完全移除独立的 -p / -P 入口
|
||||
>
|
||||
>2026.04.09 v1.3.7 1. Add support for enabling/disabling Hysteria2 port hopping and modifying port ranges after installation (sb -d); 2. Allow customization of Hysteria2 upload/download bandwidth without reinstalling; 3. Enhance client configuration with proper Hysteria2 bandwidth (up/down) and port hopping parameters; 1. 支持安装后启用/禁用 Hysteria2 端口跳跃,并可修改端口范围 (sb -d); 2. 支持自定义 Hysteria2 上下行带宽,无需重新安装; 3. 完善客户端配置,补充 Hysteria2 上传/下载速率及端口跳跃参数
|
||||
@@ -596,6 +599,7 @@ services:
|
||||
| |-- 04_experimental.json # 缓存配置文件
|
||||
| |-- 05_dns.json # DNS 规则文件
|
||||
| |-- 06_ntp.json # 服务端时间同步配置文件
|
||||
| |-- 07_http_clients.json # 专门给 sing-box 内部组件发 HTTP 请求配置文件
|
||||
| |-- 11_xtls-reality_inbounds.json # Reality vision 协议配置文件
|
||||
| |-- 12_hysteria2_inbounds.json # Hysteria2 协议配置文件
|
||||
| |-- 13_tuic_inbounds.json # Tuic V5 协议配置文件 # Hysteria2 协议配置文件
|
||||
|
||||
@@ -218,6 +218,7 @@ EOF
|
||||
cat > ${WORK_DIR}/conf/03_route.json << EOF
|
||||
{
|
||||
"route":{
|
||||
"default_http_client": "http-client-direct",
|
||||
"rule_set":[
|
||||
{
|
||||
"tag":"geosite-openai",
|
||||
@@ -294,6 +295,17 @@ EOF
|
||||
"interval": "60m"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# 专门给 sing-box 内部组件发 HTTP 请求用,比如这些场景会用到它:下载远程 rule_set:.srs 规则文件,ACME 申请证书,Cloudflare Origin CA 证书提供器,DERP / Tailscale 相关 HTTP 请求
|
||||
cat > ${WORK_DIR}/conf/07_http_clients.json << EOF
|
||||
{
|
||||
"http_clients": [
|
||||
{
|
||||
"tag": "http-client-direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
# 生成 XTLS + Reality 配置
|
||||
|
||||
+20
-8
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 当前脚本版本号
|
||||
VERSION='v1.3.12 (2026.05.14)'
|
||||
VERSION='v1.3.13 (2026.05.18)'
|
||||
|
||||
# Github 反代加速代理
|
||||
GITHUB_PROXY=('https://hub.glowp.xyz/' 'https://proxy.vvvv.ee/')
|
||||
@@ -39,8 +39,8 @@ mkdir -p "$TEMP_DIR"
|
||||
|
||||
E[0]="Language:\n 1. English (default) \n 2. 简体中文"
|
||||
C[0]="${E[0]}"
|
||||
E[1]="1. Added Hysteria2 Realm support for machines without public inbound access, with optional WARP-assisted hole punching; 2. Realm is exported for Clash/Mihomo and sing-box clients; 3. Hysteria2 Realm can be toggled directly in node configuration changes; 4. Unified the fixed STUN server list for Hysteria2 Realm."
|
||||
C[1]="1. 增加 Hysteria2 Realm 支持,适用于没有公网入口的机器,并可选 WARP 辅助打洞; 2. Realm 已支持导出 Clash/Mihomo 和 sing-box 客户端配置; 3. 修改节点配置时可直接开启或关闭 Hysteria2 Realm; 4. 统一 Hysteria2 Realm 固定 STUN 服务器列表。"
|
||||
E[1]="1. Added Hysteria2 Realm support for machines without public inbound access, with optional WARP-assisted hole punching; 2. Realm is exported for Clash/Mihomo and sing-box clients; 3. Hysteria2 Realm can be toggled directly in node configuration changes; 4. Unified the fixed STUN server list for Hysteria2 Realm; 5. Added top-level http_clients configuration"
|
||||
C[1]="1. 增加 Hysteria2 Realm 支持,适用于没有公网入口的机器,并可选 WARP 辅助打洞; 2. Realm 已支持导出 Clash/Mihomo 和 sing-box 客户端配置; 3. 修改节点配置时可直接开启或关闭 Hysteria2 Realm; 4. 统一 Hysteria2 Realm 固定 STUN 服务器列表。 5. 增加顶层的 http_clients 配置"
|
||||
E[2]="Downloading Sing-box. Please wait a seconds ..."
|
||||
C[2]="下载 Sing-box 中,请稍等 ..."
|
||||
E[3]="Input errors up to 5 times.The script is aborted."
|
||||
@@ -1164,7 +1164,7 @@ input_reality_key() {
|
||||
input_argo_auth() {
|
||||
local IS_CHANGE_ARGO=$1
|
||||
[ -n "$IS_CHANGE_ARGO" ] && local EMPTY_ERROR_TIME=5
|
||||
local DOMAIN_ERROR_TIME=6 ARGO_AUTH_LENGTH=40
|
||||
local DOMAIN_ERROR_TIME=6
|
||||
|
||||
# 处理可能输入的错误,去掉开头和结尾的空格,去掉最后的 :
|
||||
if [ "$IS_CHANGE_ARGO" = 'is_change_argo' ]; then
|
||||
@@ -1183,7 +1183,7 @@ input_argo_auth() {
|
||||
ARGO_RUNS="${WORK_DIR}/cloudflared tunnel --edge-ip-version auto --no-autoupdate --url http://localhost:$PORT_NGINX"
|
||||
elif [ -n "${ARGO_DOMAIN}" ]; then
|
||||
if [ -z "${ARGO_AUTH}" ]; then
|
||||
until [[ "$ARGO_AUTH" =~ TunnelSecret || "$ARGO_AUTH" =~ [A-Z0-9a-z=]{150,250}$ || "${#ARGO_AUTH}" = $ARGO_AUTH_LENGTH ]]; do
|
||||
until [[ "$ARGO_AUTH" =~ TunnelSecret || "$ARGO_AUTH" =~ [A-Z0-9a-z=]{120,250}$ || "${#ARGO_AUTH}" =~ ^[3-6][0-9]$ ]]; do
|
||||
[ "$DOMAIN_ERROR_TIME" != 6 ] && warning "\n $(text 86) \n"
|
||||
(( DOMAIN_ERROR_TIME-- )) || true
|
||||
[ "$DOMAIN_ERROR_TIME" != 0 ] && hint "\n $(text 85) \n " && reading "\n $(text 118) " ARGO_AUTH || error "\n $(text 3) \n"
|
||||
@@ -1196,18 +1196,18 @@ input_argo_auth() {
|
||||
ARGO_JSON=${ARGO_AUTH//[ ]/}
|
||||
[ "$IS_CHANGE_ARGO" = 'is_install' ] && export_argo_json_file $TEMP_DIR || export_argo_json_file ${WORK_DIR}
|
||||
ARGO_RUNS="${WORK_DIR}/cloudflared tunnel --edge-ip-version auto --config ${WORK_DIR}/tunnel.yml run"
|
||||
elif [[ "${ARGO_AUTH}" =~ [A-Z0-9a-z=]{150,250}$ ]]; then
|
||||
elif [[ "${ARGO_AUTH}" =~ [A-Z0-9a-z=]{120,250}$ ]]; then
|
||||
ARGO_TYPE=is_token_argo
|
||||
ARGO_TOKEN=$(awk '{print $NF}' <<< "$ARGO_AUTH")
|
||||
ARGO_RUNS="${WORK_DIR}/cloudflared tunnel --edge-ip-version auto run --token ${ARGO_TOKEN}"
|
||||
elif [[ "${#ARGO_AUTH}" = $ARGO_AUTH_LENGTH ]]; then
|
||||
elif [[ "${#ARGO_AUTH}" =~ ^[3-6][0-9]$ ]]; then
|
||||
hint "\n $(text 119) \n "
|
||||
create_argo_tunnel "${ARGO_AUTH}" "${ARGO_DOMAIN}" "${PORT_NGINX}"
|
||||
if [[ "$ARGO_JSON" =~ TunnelSecret ]]; then
|
||||
ARGO_TYPE=is_json_argo
|
||||
[ "$IS_CHANGE_ARGO" = 'is_install' ] && export_argo_json_file $TEMP_DIR || export_argo_json_file ${WORK_DIR}
|
||||
ARGO_RUNS="${WORK_DIR}/cloudflared tunnel --edge-ip-version auto --config ${WORK_DIR}/tunnel.yml run"
|
||||
elif [ "${#ARGO_TOKEN}" = 180 ]; then
|
||||
elif [[ "${#ARGO_TOKEN}" =~ ^[0-9]+$ && "${#ARGO_TOKEN}" -ge 120 && "${#ARGO_TOKEN}" -le 250 ]]; then
|
||||
ARGO_TYPE=is_token_argo
|
||||
ARGO_RUNS="${WORK_DIR}/cloudflared tunnel --edge-ip-version auto run --token ${ARGO_TOKEN}"
|
||||
else
|
||||
@@ -2942,6 +2942,7 @@ EOF
|
||||
cat > ${WORK_DIR}/conf/03_route.json << EOF
|
||||
{
|
||||
"route":{
|
||||
"default_http_client": "http-client-direct",
|
||||
"rule_set":[
|
||||
{
|
||||
"tag":"geosite-openai",
|
||||
@@ -3019,6 +3020,17 @@ EOF
|
||||
"interval": "60m"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# 专门给 sing-box 内部组件发 HTTP 请求用,比如这些场景会用到它:下载远程 rule_set:.srs 规则文件,ACME 申请证书,Cloudflare Origin CA 证书提供器,DERP / Tailscale 相关 HTTP 请求
|
||||
cat > ${WORK_DIR}/conf/07_http_clients.json << EOF
|
||||
{
|
||||
"http_clients": [
|
||||
{
|
||||
"tag": "http-client-direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user