luci-app-ssr-plus: enable multiple threads for naiveproxy

This commit is contained in:
CN_SZTL 2020-10-04 04:51:29 +08:00
parent 2d306d413d
commit 230d5ce059
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -204,7 +204,8 @@ gen_config_file() {
cat <<-EOF >/var/etc/naive-ssr-$FILE_NAME.json
{
"listen": "$PROTO://0.0.0.0:$3",
"proxy": "https://$(uci_get_by_name $1 username):$(uci_get_by_name $1 password)@$(uci_get_by_name $1 server):$(uci_get_by_name $1 server_port)"
"proxy": "https://$(uci_get_by_name $1 username):$(uci_get_by_name $1 password)@$(uci_get_by_name $1 server):$(uci_get_by_name $1 server_port)",
"concurrency": "$4"
}
EOF
;;
@ -342,12 +343,12 @@ start_redir_tcp() {
-l :$server_port $password $kcp_param
kcp_enable_flag=1
fi
gen_config_file $GLOBAL_SERVER 0 $(uci_get_by_name $GLOBAL_SERVER local_port 1234)
if [ "$(uci_get_by_type global threads 0)" == "0" ]; then
threads=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
else
threads=$(uci_get_by_type global threads)
fi
gen_config_file $GLOBAL_SERVER 0 $(uci_get_by_name $GLOBAL_SERVER local_port 1234) $threads
case "$type" in
ss | ssr)
local last_config_file=$CONFIG_FILE