From 230d5ce059e3647d1c7e4db29d39ddbe06ea86f8 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 4 Oct 2020 04:51:29 +0800 Subject: [PATCH] luci-app-ssr-plus: enable multiple threads for naiveproxy --- package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 5dd9860c7a..66eb6736db 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -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