Skip to content

Commit 335c65b

Browse files
committed
v1.0.1 Support TCP brutal. Alpha instead of latest
1 parent ea89e82 commit 335c65b

File tree

2 files changed

+82
-15
lines changed

2 files changed

+82
-15
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
* * *
1717
## 更新信息
18+
2023.11.15 v1.0.1 1. Support TCP brutal. Reinstall is required; 2. Use alpha verion instead of latest; 3. Change the default CDN to [ cn.azhz.eu.org ]; 1. 支持 TCP brutal,需要重新安装; 2. 由于 Sing-box 更新极快,将使用 alpha 版本替代 latest; 3. 默认优选改为 [ cn.azhz.eu.org ]
19+
1820
2023.10.29 v1.0 正式版 1. Sing-box Family bucket v1.0; 2. After installing, add [sb] shortcut; 3. Output the configuration for Sing-box Client; 1. Sing-box 全家桶 v1.0; 2. 安装后,增加 [sb] 的快捷运行方式; 3. 输出 Sing-box Client 配置
1921

2022
<details>

sing-box.sh

Lines changed: 80 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# 当前脚本版本号
4-
VERSION='v1.0'
4+
VERSION='v1.0.1'
55

66
# 各变量默认值
77
GH_PROXY='https://gh-proxy.com/' # 不稳定,暂不使用
@@ -11,19 +11,19 @@ START_PORT_DEFAULT='8881'
1111
MIN_PORT=1000
1212
MAX_PORT=65525
1313
TLS_SERVER=addons.mozilla.org
14-
CDN_DEFAULT=www.who.int
14+
CDN_DEFAULT=cn.azhz.eu.org
1515
PROTOCAL_LIST=("reality" "hysteria2" "tuic" "shadowTLS" "shadowsocks" "trojan" "vmess + ws" "vless + ws + tls")
1616
CONSECUTIVE_PORTS=${#PROTOCAL_LIST[@]}
17-
CDN_DOMAIN=("www.who.int" "cdn.anycast.eu.org" "443.cf.bestl.de" "cn.azhz.eu.org" "cfip.gay")
17+
CDN_DOMAIN=("cn.azhz.eu.org" "www.who.int" "cdn.anycast.eu.org" "443.cf.bestl.de" "cfip.gay")
1818

1919
trap "rm -rf $TEMP_DIR >/dev/null 2>&1 ; echo -e '\n' ;exit 1" INT QUIT TERM EXIT
2020

2121
mkdir -p $TEMP_DIR
2222

2323
E[0]="Language:\n 1. English (default) \n 2. 简体中文"
2424
C[0]="${E[0]}"
25-
E[1]="1. Sing-box Family bucket v1.0; 2. After installing, add [ sb ] shortcut; 3. Output the configuration for Sing-box Client"
26-
C[1]="1. Sing-box 全家桶 v1.0; 2. 安装后,增加 [ sb ] 的快捷运行方式; 3. 输出 Sing-box Client 的配置"
25+
E[1]="1. Support TCP brutal. Reinstall is required; 2. Use alpha verion instead of latest; 3. Change the default CDN to [ cn.azhz.eu.org ]"
26+
C[1]="1. 支持 TCP brutal,需要重新安装; 2. 由于 Sing-box 更新极快,将使用 alpha 版本替代 latest; 3. 默认优选改为 [ cn.azhz.eu.org ]"
2727
E[2]="This project is designed to add sing-box support for multiple protocols to VPS, details: [https://github.com/fscarmen/sing-box]\n Script Features:\n\t • Deploy multiple protocols with one click, there is always one for you!\n\t • Custom ports for nat machine with limited open ports.\n\t • Built-in warp chained proxy to unlock chatGPT.\n\t • No domain name is required.\n\t • Support system: Ubuntu, Debian, CentOS, Alpine and Arch Linux 3.\n\t • Support architecture: AMD,ARM and s390x\n"
2828
C[2]="本项目专为 VPS 添加 sing-box 支持的多种协议, 详细说明: [https://github.com/fscarmen/sing-box]\n 脚本特点:\n\t • 一键部署多协议,总有一款适合你\n\t • 自定义端口,适合有限开放端口的 nat 小鸡\n\t • 内置 warp 链式代理解锁 chatGPT\n\t • 不需要域名\n\t • 智能判断操作系统: Ubuntu 、Debian 、CentOS 、Alpine 和 Arch Linux,请务必选择 LTS 系统\n\t • 支持硬件结构类型: AMD 和 ARM\n"
2929
E[3]="Input errors up to 5 times.The script is aborted."
@@ -251,8 +251,8 @@ check_install() {
251251
STATUS=$(text 26) && [ -s /etc/systemd/system/sing-box.service ] && STATUS=$(text 27) && [ "$(systemctl is-active sing-box)" = 'active' ] && STATUS=$(text 28)
252252
if [[ $STATUS = "$(text 26)" ]] && [ ! -s $WORK_DIR/sing-box ]; then
253253
{
254-
local ONLINE=$(wget -qO- "https://api.github.com/repos/SagerNet/sing-box/releases/latest" | grep "tag_name" | sed "s@.*\"v\(.*\)\",@\1@g")
255-
ONLINE=${ONLINE:-'1.6.0'}
254+
local ONLINE=$(wget -qO- "https://api.github.com/repos/SagerNet/sing-box/releases" | awk -F '["v]' '/tag_name.*alpha/{print $5; exit}')
255+
ONLINE=${ONLINE:-'1.7.0-alpha.11'}
256256
wget -c ${GH_PROXY}https://github.com/SagerNet/sing-box/releases/download/v$ONLINE/sing-box-$ONLINE-linux-$SING_BOX_ARCH.tar.gz -qO- | tar xz -C $TEMP_DIR sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box
257257
[ -s $TEMP_DIR/sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box ] && mv $TEMP_DIR/sing-box-$ONLINE-linux-$SING_BOX_ARCH/sing-box $TEMP_DIR
258258
}&
@@ -635,6 +635,15 @@ EOF
635635
""
636636
]
637637
}
638+
},
639+
"multiplex":{
640+
"enabled":true,
641+
"padding":true,
642+
"brutal":{
643+
"enabled":true,
644+
"up_mbps":1000,
645+
"down_mbps":1000
646+
}
638647
}
639648
}
640649
]
@@ -703,7 +712,8 @@ EOF
703712
"password":"$UUID"
704713
}
705714
],
706-
"congestion_control":"bbr",
715+
"congestion_control": "bbr",
716+
"zero_rtt_handshake": false,
707717
"tls":{
708718
"enabled":true,
709719
"alpn":[
@@ -751,7 +761,16 @@ EOF
751761
"listen":"127.0.0.1",
752762
"network":"tcp",
753763
"method":"2022-blake3-aes-128-gcm",
754-
"password":"$SHADOWTLS_PASSWORD"
764+
"password":"$SHADOWTLS_PASSWORD",
765+
"multiplex":{
766+
"enabled":true,
767+
"padding":true,
768+
"brutal":{
769+
"enabled":true,
770+
"up_mbps":1000,
771+
"down_mbps":1000
772+
}
773+
}
755774
}
756775
]
757776
}
@@ -773,7 +792,16 @@ EOF
773792
"listen":"::",
774793
"listen_port":$PORT_SHADOWSOCKS,
775794
"method":"aes-128-gcm",
776-
"password":"$UUID"
795+
"password":"$UUID",
796+
"multiplex":{
797+
"enabled":true,
798+
"padding":true,
799+
"brutal":{
800+
"enabled":true,
801+
"up_mbps":1000,
802+
"down_mbps":1000
803+
}
804+
}
777805
}
778806
]
779807
}
@@ -803,6 +831,15 @@ EOF
803831
"enabled":true,
804832
"certificate_path":"$WORK_DIR/cert/cert.pem",
805833
"key_path":"$WORK_DIR/cert/private.key"
834+
},
835+
"multiplex":{
836+
"enabled":true,
837+
"padding":true,
838+
"brutal":{
839+
"enabled":true,
840+
"up_mbps":1000,
841+
"down_mbps":1000
842+
}
806843
}
807844
}
808845
]
@@ -837,6 +874,15 @@ EOF
837874
"path":"/${UUID}-vmess",
838875
"max_early_data":2048,
839876
"early_data_header_name":"Sec-WebSocket-Protocol"
877+
},
878+
"multiplex":{
879+
"enabled":true,
880+
"padding":true,
881+
"brutal":{
882+
"enabled":true,
883+
"up_mbps":1000,
884+
"down_mbps":1000
885+
}
840886
}
841887
}
842888
]
@@ -879,6 +925,15 @@ EOF
879925
"max_version":"1.3",
880926
"certificate_path":"${WORK_DIR}/cert/cert.pem",
881927
"key_path":"${WORK_DIR}/cert/private.key"
928+
},
929+
"multiplex":{
930+
"enabled":true,
931+
"padding":true,
932+
"brutal":{
933+
"enabled":true,
934+
"up_mbps":1000,
935+
"down_mbps":1000
936+
}
882937
}
883938
}
884939
]
@@ -1077,7 +1132,13 @@ $(info "$(text 54)
10771132
\"method\":\"2022-blake3-aes-128-gcm\",
10781133
\"password\":\"${SHADOWTLS_PASSWORD}\",
10791134
\"type\":\"shadowsocks\",
1080-
\"udp_over_tcp\":false
1135+
\"udp_over_tcp\": false,
1136+
\"multiplex\": {
1137+
\"enabled\": true,
1138+
\"protocol\": \"h2mux\",
1139+
\"max_connections\": 16,
1140+
\"padding\": true
1141+
}
10811142
},
10821143
{
10831144
\"domain_strategy\":\"\",
@@ -1093,6 +1154,10 @@ $(info "$(text 54)
10931154
\"fingerprint\": \"chrome\"
10941155
}
10951156
},
1157+
\"multiplex\":{
1158+
\"enabled\":true,
1159+
\"padding\":true
1160+
},
10961161
\"type\":\"shadowtls\",
10971162
\"version\":3
10981163
}
@@ -1418,7 +1483,7 @@ $(info " {
14181483
\"enabled\":true,
14191484
\"protocol\":\"h2mux\",
14201485
\"max_connections\": 16,
1421-
\"padding\":true
1486+
\"padding\": true
14221487
}
14231488
},")
14241489
EOF
@@ -1442,7 +1507,7 @@ $(info " {
14421507
\"enabled\":true,
14431508
\"protocol\":\"h2mux\",
14441509
\"max_streams\":16,
1445-
\"padding\":true
1510+
\"padding\": true
14461511
}
14471512
},")
14481513
EOF
@@ -1474,7 +1539,7 @@ $(info " {
14741539
\"enabled\":true,
14751540
\"protocol\":\"h2mux\",
14761541
\"max_streams\":16,
1477-
\"padding\":true
1542+
\"padding\": true
14781543
}
14791544
},")
14801545
EOF
@@ -1726,7 +1791,7 @@ uninstall() {
17261791
17271792
# Sing-box 的最新版本
17281793
version() {
1729-
local ONLINE=$(wget -qO- "https://api.github.com/repos/SagerNet/sing-box/releases/latest" | grep "tag_name" | sed "s@.*\"v\(.*\)\",@\1@g")
1794+
local ONLINE=$(wget -qO- "https://api.github.com/repos/SagerNet/sing-box/releases" | awk -F '["v]' '/tag_name.*alpha/{print $5; exit}')
17301795
local LOCAL=$($WORK_DIR/sing-box version | awk '/version/{print $NF}')
17311796
info "\n $(text 40) "
17321797
[[ -n "$ONLINE" && "$ONLINE" != "$LOCAL" ]] && reading "\n $(text 9) " UPDATE || info " $(text 41) "

0 commit comments

Comments
 (0)