update 2026-06-30 02:05:35

This commit is contained in:
action 2026-06-30 02:05:35 +08:00
parent f769dc4727
commit ef3f9d84dd
4 changed files with 79 additions and 65 deletions

View File

@ -260,8 +260,10 @@ if is_finded("xray") then
o = s:option(Value, "fragment_length", translate("Fragment Length"))
if xray_version_val <= 260601 then
o.datatype = "or(uinteger,portrange)"
o.default = "100-200"
else
o.default = "3-5,6-8,10-20"
end
o.default = "100-200"
o:depends("fragment", true)
o.description = translate(
"<ul>" ..
@ -273,8 +275,10 @@ if is_finded("xray") then
o = s:option(Value, "fragment_delay", translate("Fragment Delay"))
if xray_version_val <= 260601 then
o.datatype = "or(uinteger,portrange)"
o.default = "10-20"
else
o.default = "1-2,5-6,10-20"
end
o.default = "10-20"
o:depends("fragment", true)
o.description = translate(
"<ul>" ..
@ -285,7 +289,12 @@ if is_finded("xray") then
o = s:option(Value, "fragment_maxSplit", translate("Max Split"), translate("Limit the maximum number of splits."))
o.datatype = "or(uinteger,portrange)"
o.default = "100-200"
if xray_version_val <= 260601 then
o.datatype = "or(uinteger,portrange)"
o.default = "100-200"
else
o.default = "3-6-8"
end
o:depends("fragment", true)
o = s:option(Flag, "noise", translate("Noise"), translate("UDP noise, Under some circumstances it can bypass some UDP based protocol restrictions."))

View File

@ -64,7 +64,7 @@ msgstr ""
msgid "8 Threads"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:296
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:305
msgid "<font style='color:red'>"
msgstr ""
@ -80,8 +80,8 @@ msgid ""
"etc.</h3>"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:267
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:280
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:269
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:284
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1321
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1642
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1655
@ -456,7 +456,7 @@ msgstr ""
msgid "Clear logs"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:300
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:309
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1151
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1506
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1533
@ -706,7 +706,7 @@ msgid ""
"entries before the original Clash rules."
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:338
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:347
msgid "Delay (ms)"
msgstr ""
@ -772,7 +772,7 @@ msgstr ""
msgid "DoT upstream (Need use wolfssl version)"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:325
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:334
msgid "Domain Strategy"
msgstr ""
@ -824,7 +824,7 @@ msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:177
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:218
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:314
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:323
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/server-config.lua:54
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/server.lua:101
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua:588
@ -1064,7 +1064,7 @@ msgid ""
"Chinese CDN IP addresses"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:298
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:307
msgid "For specific usage, see:"
msgstr ""
@ -1078,7 +1078,7 @@ msgstr ""
msgid "Fragment"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:273
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:275
msgid "Fragment Delay"
msgstr ""
@ -1090,11 +1090,11 @@ msgstr ""
msgid "Fragment Packets"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:281
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:285
msgid "Fragmentation interval (ms)"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:268
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:270
msgid "Fragmented packet length (byte)"
msgstr ""
@ -1505,7 +1505,7 @@ msgstr ""
msgid "Level 3 Public DNS-3 (4.2.2.3-4)"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:286
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:290
msgid "Limit the maximum number of splits."
msgstr ""
@ -1584,7 +1584,7 @@ msgstr ""
msgid "Max Early Data"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:286
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:290
msgid "Max Split"
msgstr ""
@ -1757,7 +1757,7 @@ msgid ""
"the table."
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:291
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:300
msgid "Noise"
msgstr ""
@ -1795,13 +1795,13 @@ msgid ""
"compatibility issues."
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:282
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:286
msgid ""
"Note: When version is higher than 26.6.1, input multiple fragment intervals "
"saperate with ','."
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:269
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:271
msgid ""
"Note: When version is higher than 26.6.1, input multiple fragment lengths "
"saperate with ','."
@ -1881,11 +1881,11 @@ msgstr ""
msgid "Package Name"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:297
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:306
msgid "Packet or Rand length as a string, e.g., 10-20."
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:334
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:343
msgid "Packet | Rand Length"
msgstr ""
@ -2694,7 +2694,7 @@ msgstr ""
msgid "Timeout for establishing a connection to server(second)"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:296
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:305
msgid "To send noise packets, select \"Noise\" in Xray Settings."
msgstr ""
@ -2725,7 +2725,7 @@ msgstr ""
msgid "Try Count"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:318
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:327
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua:702
msgid "Type"
msgstr ""
@ -2734,7 +2734,7 @@ msgstr ""
msgid "UDP"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:291
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:300
msgid ""
"UDP noise, Under some circumstances it can bypass some UDP based protocol "
"restrictions."
@ -3068,7 +3068,7 @@ msgstr ""
msgid "Xray Fragment Settings"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:294
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:303
msgid "Xray Noise Packets"
msgstr ""

View File

@ -66,7 +66,7 @@ msgstr ""
msgid "8 Threads"
msgstr "8 线程"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:296
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:305
msgid "<font style='color:red'>"
msgstr ""
@ -84,8 +84,8 @@ msgstr ""
"<h3>支持 SS/SSR/V2RAY/XRAY/TROJAN/TUIC/HYSTERIA2/NAIVEPROXY/SOCKS5/CLASH 等协"
"议。</h3>"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:267
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:280
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:269
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:284
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1321
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1642
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1655
@ -460,7 +460,7 @@ msgstr "清空所有自定义客户端代理规则,并恢复为空白状态吗
msgid "Clear logs"
msgstr "清空日志"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:300
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:309
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1151
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1506
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1533
@ -715,7 +715,7 @@ msgstr ""
"为每个客户端指定 Mihomo 代理目标。规则会以 SRC-IP-CIDR 形式注入到原始 Clash "
"规则之前。"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:338
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:347
msgid "Delay (ms)"
msgstr "延迟ms"
@ -781,7 +781,7 @@ msgstr "是否要恢复客户端默认配置?"
msgid "DoT upstream (Need use wolfssl version)"
msgstr "DoT 上游(需使用 wolfssl 版本)"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:325
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:334
msgid "Domain Strategy"
msgstr "域名解析策略"
@ -833,7 +833,7 @@ msgstr "编辑服务器配置"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:177
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:218
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:314
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:323
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/server-config.lua:54
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/server.lua:101
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua:588
@ -1073,7 +1073,7 @@ msgid ""
"Chinese CDN IP addresses"
msgstr "配备中国大陆 CDN 的 Apple 域名,始终应答中国大陆 CDN 地址"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:298
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:307
msgid "For specific usage, see:"
msgstr "具体使用方法,具体请参见:"
@ -1087,7 +1087,7 @@ msgstr "格式为10000:20000 或 10000-20000 多组时用逗号(,)隔开
msgid "Fragment"
msgstr "分片"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:273
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:275
msgid "Fragment Delay"
msgstr "分片延迟"
@ -1099,11 +1099,11 @@ msgstr "分片包长"
msgid "Fragment Packets"
msgstr "分片方式"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:281
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:285
msgid "Fragmentation interval (ms)"
msgstr "分片间隔ms"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:268
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:270
msgid "Fragmented packet length (byte)"
msgstr "分片包长 (byte)"
@ -1515,7 +1515,7 @@ msgstr ""
msgid "Level 3 Public DNS-3 (4.2.2.3-4)"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:286
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:290
msgid "Limit the maximum number of splits."
msgstr "限制分片的最大数量。"
@ -1596,7 +1596,7 @@ msgstr "未找到匹配的发布资产"
msgid "Max Early Data"
msgstr "最大前置数据"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:286
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:290
msgid "Max Split"
msgstr "最大分片数"
@ -1772,7 +1772,7 @@ msgid ""
msgstr ""
"节点顺序可用鼠标拖拉后立即生效,服务器节点自动切换顺序和表中节点顺序一致。"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:291
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:300
msgid "Noise"
msgstr "噪声"
@ -1810,13 +1810,13 @@ msgid ""
"compatibility issues."
msgstr "注意:不同版本间的配置恢复可能会导致兼容性问题。"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:282
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:286
msgid ""
"Note: When version is higher than 26.6.1, input multiple fragment intervals "
"saperate with ','."
msgstr "注意:当版本高于 26.6.1 时,可以输入多个分片间隔,并用英文 ',' 分隔。"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:269
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:271
msgid ""
"Note: When version is higher than 26.6.1, input multiple fragment lengths "
"saperate with ','."
@ -1896,11 +1896,11 @@ msgstr "包管理器"
msgid "Package Name"
msgstr "组件包名称"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:297
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:306
msgid "Packet or Rand length as a string, e.g., 10-20."
msgstr "数据包或 Rand 长度以字符串形式输入例如10-20。"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:334
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:343
msgid "Packet | Rand Length"
msgstr "数据包 | Rand 长度"
@ -2722,7 +2722,7 @@ msgstr "超时"
msgid "Timeout for establishing a connection to server(second)"
msgstr "连接超时时间(单位:秒)"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:296
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:305
msgid "To send noise packets, select \"Noise\" in Xray Settings."
msgstr "在 Xray 设置中勾选 “噪声” 以发送噪声包。"
@ -2753,7 +2753,7 @@ msgstr "Trojan 密码"
msgid "Try Count"
msgstr "重试次数"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:318
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:327
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua:702
msgid "Type"
msgstr "类型"
@ -2762,7 +2762,7 @@ msgstr "类型"
msgid "UDP"
msgstr ""
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:291
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:300
msgid ""
"UDP noise, Under some circumstances it can bypass some UDP based protocol "
"restrictions."
@ -3098,7 +3098,7 @@ msgstr "Xray"
msgid "Xray Fragment Settings"
msgstr "Xray 分片设置"
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:294
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:303
msgid "Xray Noise Packets"
msgstr "Xray 噪声数据包"

View File

@ -11,6 +11,14 @@ local socks_port = arg[4] or "0"
local chain = arg[5] or "0"
-- trim
local function trim(text)
if not text or text == "" then
return ""
end
return (text:gsub("^%s*(.-)%s*$", "%1"))
end
-- 辅助函数:拆分字符串(若 luci.util 未加载则定义)
local function split(str, pat)
local t = {}
@ -732,26 +740,11 @@ Xray.outbounds = {
local n_maxsplit = xray_fragment.fragment_maxSplit
--local domainstr = xray_noise.domainStrategy
finalmask.tcp = finalmask.tcp or {}
-- 辅助函数:将逗号分隔的字符串拆分为数组
local function split_to_array(str)
if not str or str == "" then return nil end
local result = {}
for value in string.gmatch(str, "[^,]+") do
value = value:gsub("^%s*(.-)%s*$", "%1") -- 去除首尾空格
if value ~= "" then
table.insert(result, value)
end
end
return #result > 0 and result or nil
end
-- 构建 fragment settings
local fragment_settings = {
packets = (n_packets and n_packets ~= "") and n_packets or nil,
maxSplit = (n_maxsplit and n_maxsplit ~= "") and n_maxsplit or nil
}
-- 根据 Xray 版本决定使用旧格式还是新格式
if xray_version_val <= 260601 then
-- 旧版本:使用 length 和 delay单个值
@ -767,18 +760,30 @@ Xray.outbounds = {
end
else
-- 新版本:使用 lengths 和 delays数组
-- 拆分逗号分隔的字符串
-- 将逗号分隔的字符串拆分为数组
local function split_to_array(str)
if not str or str == "" then return nil end
local result = {}
local trimmed = trim(str)
if trimmed and trimmed ~= "" then
trimmed:gsub("[^,]+", function(w)
w = w:gsub("%s+", "")
if w ~= "" then
result[#result + 1] = w
end
end)
end
return #result > 0 and result or nil
end
local lengths_array = split_to_array(n_length)
if lengths_array then
fragment_settings.lengths = lengths_array
end
local delays_array = split_to_array(n_delay)
if delays_array then
fragment_settings.delays = delays_array
end
end
finalmask.tcp[#finalmask.tcp + 1] = {
type = "fragment",
settings = fragment_settings