Răsfoiți Sursa

luci-app-ssr-plus: update config for naiveproxy

Disable concurrency by default.

Signed-off-by: Tianling Shen <[email protected]>
Tianling Shen 4 ani în urmă
părinte
comite
2f8d601388

+ 1 - 1
luci-app-ssr-plus/luasrc/view/shadowsocksr/server_list.htm

@@ -55,7 +55,7 @@
 			thread()
 		}
 	})
-	
+
 	function cbi_row_drop(fromId, toId, store, isToBottom) {
 		var fromNode = document.getElementById(fromId);
 		var toNode = document.getElementById(toId);

+ 3 - 2
luci-app-ssr-plus/root/etc/init.d/shadowsocksr

@@ -326,7 +326,7 @@ gen_config_file() { #server1 type2 code3 local_port4 socks_port5 threads5
 			lua /usr/share/shadowsocksr/gen_config.lua $1 redir $4 $5 >$config_file
 			;;
 		3)
-			lua /usr/share/shadowsocksr/gen_config.lua $1 redir $4 $5 >$config_file
+			lua /usr/share/shadowsocksr/gen_config.lua $1 redir $4 >$config_file
 			lua /usr/share/shadowsocksr/gen_config.lua $1 socks $tmp_port >$shunt_dns_config_file
 			;;
 		4)
@@ -564,7 +564,8 @@ Start_Run() {
 		echolog "Main node:$($(first_type $type) --version 2>&1 | head -1) , $threads Threads Started!"
 		;;
 	naiveproxy)
-		gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
+		[ "$(uci_get_by_type global threads 0)" == "0" ] && threads=1
+		gen_config_file $GLOBAL_SERVER $type 1 $tcp_port $threads
 		ln_start_bin $(first_type naive) naive $tcp_config_file
 		echolog "Main node:$($(first_type naive) --version 2>&1 | head -1) , $threads Threads Started!"
 		;;

+ 1 - 1
luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua

@@ -221,7 +221,7 @@ local trojan = {
 local naiveproxy = {
 	proxy = (server.username and server.password and server.server and server.server_port) and "https://" .. server.username .. ":" .. server.password .. "@" .. server.server .. ":" .. server.server_port,
 	listen = (proto == "redir") and "redir" .. "://0.0.0.0:" .. tonumber(local_port) or "socks" .. "://0.0.0.0:" .. tonumber(local_port),
-	concurrency = (socks_port ~= "0") and tonumber(socks_port) or "1"
+	["insecure-concurrency"] = (socks_port ~= "0") and tonumber(socks_port) or "1"
 }
 local ss = {
 	server = (server.kcp_enable == "1") and "127.0.0.1" or server.server,