소스 검색

luci-app-ssr-plus: Update `xhttp` protocol configuration problem

zxlhhyccc 8 달 전
부모
커밋
c99a1ef924

+ 1 - 0
luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua

@@ -1076,6 +1076,7 @@ o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "splithttp"})
 o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "h2"})
 o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "quic"})
 o:depends({type = "v2ray", v2ray_protocol = "vless", transport = "grpc"})
+o:depends({type = "v2ray", v2ray_protocol = "vmess"})
 o:depends({type = "v2ray", v2ray_protocol = "trojan"})
 o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"})
 o:depends({type = "v2ray", v2ray_protocol = "socks"})

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

@@ -4,7 +4,7 @@
 -%>
 <script type="text/javascript">
 	//<![CDATA[
-	window.addEventListener('load',function(){
+	window.addEventListener('load', function () {
 		const doms = document.getElementsByClassName('pingtime');
 		const ports = document.getElementsByClassName("socket-connected");
 		const transports = document.getElementsByClassName("transport");
@@ -17,7 +17,7 @@
 				const transport = transports[index];
 				const wsPath = wsPaths[index];
 				const tls = tlss[index];
-				if (!dom) res()
+				if (!dom) res();
 				port.innerHTML = '<font style=\"color:#0072c3\">connect</font>';
 				XHR.get('<%=luci.dispatcher.build_url("admin/services/shadowsocksr/ping")%>', {
 					index,
@@ -34,7 +34,7 @@
 						if (result.ping < 200) col = '#ff7700';
 						if (result.ping < 100) col = '#249400';
 					}
-					dom.innerHTML = `<font style=\"color:${col}\">${(result.ping ? result.ping : "--") + " ms"}</font>`
+					dom.innerHTML = `<font style=\"color:${col}\">${(result.ping ? result.ping : "--") + " ms"}</font>`;
 					if (result.socket) {
 						port.innerHTML = '<font style=\"color:#249400\">ok</font>';
 					} else {
@@ -42,19 +42,19 @@
 					}
 					res();
 				});
-			})
-		}
+			});
+		};
 		let task = -1;
 		const thread = () => {
-			task = task + 1
+			task = task + 1;
 			if (doms[task]) {
 				xhr(task).then(thread);
 			}
-		}
+		};
 		for (let i = 0; i < 20; i++) {
-			thread()
+			thread();
 		}
-	})
+	});
 
 	function cbi_row_drop(fromId, toId, store, isToBottom) {
 		var fromNode = document.getElementById(fromId);
@@ -85,6 +85,7 @@
 		if (input) input.value = ids.join(" ");
 		return false;
 	}
+
 	// set tr draggable
 	function enableDragForTable(table_selecter, store) {
 		var trs = document.querySelectorAll(table_selecter + " tr");
@@ -137,9 +138,11 @@
 			}
 		}
 	}
+
 	// enable
 	enableDragForTable(
 		"#cbi-shadowsocksr-servers table",
 		"cbi.sts.shadowsocksr.servers"
 	);
+	//]]>
 </script>

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

@@ -310,7 +310,7 @@ end
 				} or nil,
 				sockopt = {
 					mark = 250,
-					tcpFastOpen = (server.tcpfastOpen == "1") and true or false, -- XHTTP Tcp Fast Open
+					tcpFastOpen = ((server.transport == "xhttp" and server.tcpfastopen == "1") and true or false) or (server.transport ~= "xhttp") and nil, -- XHTTP Tcp Fast Open
 					tcpMptcp = (server.mptcp == "1") and true or nil, -- MPTCP
 					Penetrate = (server.mptcp == "1") and true or nil, -- Penetrate MPTCP
 					tcpcongestion = server.custom_tcpcongestion, -- 连接服务器节点的 TCP 拥塞控制算法
@@ -350,7 +350,7 @@ if xray_fragment.fragment ~= "0" or (xray_fragment.noise ~= "0" and xray_noise.e
 		streamSettings = {
 			sockopt = {
 			mark = 250,
-			tcpFastOpen = (server.tcpfastOpen == "1") and true or false, -- XHTTP Tcp Fast Open
+			tcpFastOpen = ((server.transport == "xhttp" and server.tcpfastopen == "1") and true or false) or (server.transport ~= "xhttp") and nil, -- XHTTP Tcp Fast Open
 			tcpMptcp = (server.mptcp == "1") and true or nil, -- MPTCP
 			Penetrate = (server.mptcp == "1") and true or nil, -- Penetrate MPTCP
 			tcpcongestion = server.custom_tcpcongestion -- 连接服务器节点的 TCP 拥塞控制算法