diff --git a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua index ea08f58bda5..0f8cd034bcf 100644 --- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua +++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua @@ -1,5 +1,8 @@ local uci = luci.model.uci.cursor() local server_table = {} +local function is_finded(e) + return luci.sys.exec('type -t -p "%s"' % e) ~= "" and true or false +end uci:foreach("shadowsocksr", "servers", function(s) if s.alias then @@ -69,7 +72,9 @@ o:depends("netflix_enable", "1") o = s:option(ListValue, "shunt_dns_mode", translate("DNS Query Mode For Shunt Mode")) o:value("1", translate("Use DNS2SOCKS query and cache")) +if is_finded("mosdns") then o:value("2", translate("Use MOSDNS query")) +end o:depends("netflix_enable", "1") o.default = 1 diff --git a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua index de5abf86aca..a88745e09a1 100644 --- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua +++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua @@ -920,6 +920,7 @@ o.rmempty = true -- [[ Mux ]]-- o = s:option(Flag, "mux", translate("Mux")) o.rmempty = false +o.default = false o:depends({type = "v2ray", v2ray_protocol = "vless"}) o:depends({type = "v2ray", v2ray_protocol = "vmess"}) o:depends({type = "v2ray", v2ray_protocol = "trojan"}) @@ -931,13 +932,13 @@ o = s:option(Value, "concurrency", translate("concurrency")) o.datatype = "integer" o.rmempty = true o.default = "-1" -o:depends("mux", "1") +o:depends("mux", true) o = s:option(Value, "xudpConcurrency", translate("xudpConcurrency")) o.datatype = "integer" o.rmempty = true o.default = "16" -o:depends("mux", "1") +o:depends("mux", true) o = s:option(Value, "xudpProxyUDP443", translate("xudpProxyUDP443")) o.rmempty = true @@ -945,11 +946,12 @@ o.default = "reject" o:value("reject", translate("reject")) o:value("allow", translate("allow")) o:value("skip", translate("skip")) -o:depends("mux", "1") +o:depends("mux", true) -- [[ MPTCP ]]-- o = s:option(Flag, "mptcp", translate("MPTCP")) o.rmempty = false +o.default = false o:depends({type = "v2ray", v2ray_protocol = "vless"}) o:depends({type = "v2ray", v2ray_protocol = "vmess"}) o:depends({type = "v2ray", v2ray_protocol = "trojan"}) @@ -957,6 +959,29 @@ o:depends({type = "v2ray", v2ray_protocol = "shadowsocks"}) o:depends({type = "v2ray", v2ray_protocol = "socks"}) o:depends({type = "v2ray", v2ray_protocol = "http"}) +-- [[ custom_sniffing ]]-- +o = s:option(Flag, "custom_sniffing", translate("custom_sniffing")) +o.rmempty = false +o.default = true +o:depends({type = "v2ray", v2ray_protocol = "vless"}) +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"}) +o:depends({type = "v2ray", v2ray_protocol = "http"}) + +-- [[ custom_domainsExcluded ]]-- +o = s:option(Flag, "custom_domainsExcluded", translate("custom_domainsExcluded")) +o.rmempty = false +o.default = true +o:depends("custom_sniffing", true) + +-- [[ custom_routeOnly ]]-- +o = s:option(Flag, "custom_routeOnly", translate("custom_routeOnly")) +o.rmempty = false +o.default = false +o:depends("custom_sniffing", true) + -- [[ Cert ]]-- o = s:option(Flag, "certificate", translate("Self-signed Certificate")) o.rmempty = true diff --git a/luci-app-ssr-plus/po/zh-cn/ssr-plus.po b/luci-app-ssr-plus/po/zh-cn/ssr-plus.po index 2bd12182346..abae3a64bea 100644 --- a/luci-app-ssr-plus/po/zh-cn/ssr-plus.po +++ b/luci-app-ssr-plus/po/zh-cn/ssr-plus.po @@ -97,6 +97,15 @@ msgstr "UDP 最大并发连接数" msgid "xudpProxyUDP443" msgstr "对被代理的 UDP/443 流量处理方式" +msgid "custom_sniffing" +msgstr "流量嗅探" + +msgid "custom_domainsExcluded" +msgstr "流量嗅探域名排除列表" + +msgid "custom_routeOnly" +msgstr "嗅探得到的域名仅用于 Xray 内部路由" + msgid "If true, allowss insecure connection at TLS client, e.g., TLS server uses unverifiable certificates." msgstr "是否允许不安全连接。当选择时,将不会检查远端主机所提供的 TLS 证书的有效性。" diff --git a/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua b/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua index 8a89a87a12a..92ccf558b07 100755 --- a/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua +++ b/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua @@ -126,7 +126,38 @@ local Xray = { port = tonumber(local_port), protocol = "dokodemo-door", settings = {network = proto, followRedirect = true}, - sniffing = {enabled = true, destOverride = {"http", "tls", "quic"}} + sniffing = { + enabled = (server.custom_sniffing == "1") and true or false, + routeOnly = (server.custom_routeOnly == "1") and true or false, + destOverride = {"http", "tls", "quic"}, + domainsExcluded = (server.custom_domainsExcluded == "1") and { + "courier.push.apple.com", + "rbsxbxp-mim.vivox.com", + "rbsxbxp.www.vivox.com", + "rbsxbxp-ws.vivox.com", + "rbspsxp.www.vivox.com", + "rbspsxp-mim.vivox.com", + "rbspsxp-ws.vivox.com", + "rbswxp.www.vivox.com", + "rbswxp-mim.vivox.com", + "disp-rbspsp-5-1.vivox.com", + "disp-rbsxbp-5-1.vivox.com", + "proxy.rbsxbp.vivox.com", + "proxy.rbspsp.vivox.com", + "proxy.rbswp.vivox.com", + "rbswp.vivox.com", + "rbsxbp.vivox.com", + "rbspsp.vivox.com", + "rbspsp.www.vivox.com", + "rbswp.www.vivox.com", + "rbsxbp.www.vivox.com", + "rbsxbxp.vivox.com", + "rbspsxp.vivox.com", + "rbswxp.vivox.com", + "Mijia Cloud", + "dlg.io.mi.com" + } or nil, + } } or nil, -- 开启 socks 代理 inboundDetour = (proto:find("tcp") and socks_port ~= "0") and {