Skip to content

Commit 06dd259

Browse files
authored
Merge pull request #1767 from zxlhhyccc/custom
luci-app-ssr-plus: Freedom: Add `maxSplit` fragment option; Add `applyTo` noises option
2 parents 1c86ad9 + 49b0a5f commit 06dd259

File tree

4 files changed

+130
-93
lines changed

4 files changed

+130
-93
lines changed

luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua

Lines changed: 78 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -344,78 +344,89 @@ o.rmempty = false
344344

345345
-- [[ fragmen Settings ]]--
346346
if is_finded("xray") then
347-
s = m:section(TypedSection, "global_xray_fragment", translate("Xray Fragment Settings"))
348-
s.anonymous = true
349-
350-
o = s:option(Flag, "fragment", translate("Fragment"), translate("TCP fragments, which can deceive the censorship system in some cases, such as bypassing SNI blacklists."))
351-
o.default = 0
352-
353-
o = s:option(ListValue, "fragment_packets", translate("Fragment Packets"), translate("\"1-3\" is for segmentation at TCP layer, applying to the beginning 1 to 3 data writes by the client. \"tlshello\" is for TLS client hello packet fragmentation."))
354-
o.default = "tlshello"
355-
o:value("tlshello", "tlshello")
356-
o:value("1-1", "1-1")
357-
o:value("1-2", "1-2")
358-
o:value("1-3", "1-3")
359-
o:value("1-5", "1-5")
360-
o:depends("fragment", true)
361-
362-
o = s:option(Value, "fragment_length", translate("Fragment Length"), translate("Fragmented packet length (byte)"))
363-
o.default = "100-200"
364-
o:depends("fragment", true)
365-
366-
o = s:option(Value, "fragment_interval", translate("Fragment Interval"), translate("Fragmentation interval (ms)"))
367-
o.default = "10-20"
368-
o:depends("fragment", true)
369-
370-
o = s:option(Flag, "noise", translate("Noise"), translate("UDP noise, Under some circumstances it can bypass some UDP based protocol restrictions."))
371-
o.default = 0
372-
373-
s = m:section(TypedSection, "xray_noise_packets", translate("Xray Noise Packets"))
374-
s.description = translate(
375-
"<font style='color:red'>" .. translate("To send noise packets, select \"Noise\" in Xray Settings.") .. "</font>" ..
376-
"<br/><font><b>" .. translate("For specific usage, see:") .. "</b></font>" ..
377-
"<a href='https://xtls.github.io/config/outbounds/freedom.html' target='_blank'>" ..
378-
"<font style='color:green'><b>" .. translate("Click to the page") .. "</b></font></a>")
379-
s.template = "cbi/tblsection"
380-
s.sortable = true
381-
s.anonymous = true
382-
s.addremove = true
383-
384-
s.remove = function(self, section)
385-
for k, v in pairs(self.children) do
386-
v.rmempty = true
387-
v.validate = nil
347+
s = m:section(TypedSection, "global_xray_fragment", translate("Xray Fragment Settings"))
348+
s.anonymous = true
349+
350+
o = s:option(Flag, "fragment", translate("Fragment"), translate("TCP fragments, which can deceive the censorship system in some cases, such as bypassing SNI blacklists."))
351+
o.default = 0
352+
353+
o = s:option(ListValue, "fragment_packets", translate("Fragment Packets"), translate("\"1-3\" is for segmentation at TCP layer, applying to the beginning 1 to 3 data writes by the client. \"tlshello\" is for TLS client hello packet fragmentation."))
354+
o.default = "tlshello"
355+
o:value("tlshello", "tlshello")
356+
o:value("1-1", "1-1")
357+
o:value("1-2", "1-2")
358+
o:value("1-3", "1-3")
359+
o:value("1-5", "1-5")
360+
o:depends("fragment", true)
361+
362+
o = s:option(Value, "fragment_length", translate("Fragment Length"), translate("Fragmented packet length (byte)"))
363+
o.default = "100-200"
364+
o:depends("fragment", true)
365+
366+
o = s:option(Value, "fragment_interval", translate("Fragment Interval"), translate("Fragmentation interval (ms)"))
367+
o.default = "10-20"
368+
o:depends("fragment", true)
369+
370+
o = s:option(Value, "fragment_maxsplit", translate("Fragment maxSplit"), translate("Fragmented maxSplit (byte)"))
371+
o.default = "100-200"
372+
o:depends("fragment", true)
373+
374+
o = s:option(Flag, "noise", translate("Noise"), translate("UDP noise, Under some circumstances it can bypass some UDP based protocol restrictions."))
375+
o.default = 0
376+
377+
s = m:section(TypedSection, "xray_noise_packets", translate("Xray Noise Packets"))
378+
s.description = translate(
379+
"<font style='color:red'>" .. translate("To send noise packets, select \"Noise\" in Xray Settings.") .. "</font>" ..
380+
"<br/><font><b>" .. translate("For specific usage, see:") .. "</b></font>" ..
381+
"<a href='https://xtls.github.io/config/outbounds/freedom.html' target='_blank'>" ..
382+
"<font style='color:green'><b>" .. translate("Click to the page") .. "</b></font></a>")
383+
s.template = "cbi/tblsection"
384+
s.sortable = true
385+
s.anonymous = true
386+
s.addremove = true
387+
388+
s.remove = function(self, section)
389+
for k, v in pairs(self.children) do
390+
v.rmempty = true
391+
v.validate = nil
392+
end
393+
TypedSection.remove(self, section)
388394
end
389-
TypedSection.remove(self, section)
390-
end
391395

392-
o = s:option(Flag, "enabled", translate("Enable"))
393-
o.default = 1
394-
o.rmempty = false
396+
o = s:option(Flag, "enabled", translate("Enable"))
397+
o.default = 1
398+
o.rmempty = false
395399

396-
o = s:option(ListValue, "type", translate("Type"))
397-
o.default = "base64"
398-
o:value("rand", "rand")
399-
o:value("str", "str")
400-
o:value("hex", "hex")
401-
o:value("base64", "base64")
402-
403-
o = s:option(Value, "domainStrategy", translate("Domain Strategy"))
404-
o.default = "UseIP"
405-
o:value("AsIs", "AsIs")
406-
o:value("UseIP", "UseIP")
407-
o:value("UseIPv4", "UseIPv4")
408-
o:value("ForceIP", "ForceIP")
409-
o:value("ForceIPv4", "ForceIPv4")
410-
o.rmempty = false
400+
o = s:option(ListValue, "type", translate("Type"))
401+
o.default = "base64"
402+
o:value("rand", "rand")
403+
o:value("str", "str")
404+
o:value("hex", "hex")
405+
o:value("base64", "base64")
406+
407+
o = s:option(Value, "domainStrategy", translate("Domain Strategy"))
408+
o.default = "UseIP"
409+
o:value("AsIs", "AsIs")
410+
o:value("UseIP", "UseIP")
411+
o:value("UseIPv4", "UseIPv4")
412+
o:value("ForceIP", "ForceIP")
413+
o:value("ForceIPv4", "ForceIPv4")
414+
o.rmempty = false
411415

412-
o = s:option(Value, "packet", translate("Packet"))
413-
o.datatype = "minlength(1)"
414-
o.rmempty = false
416+
o = s:option(Value, "packet", translate("Packet"))
417+
o.datatype = "minlength(1)"
418+
o.rmempty = false
415419

416-
o = s:option(Value, "delay", translate("Delay (ms)"))
417-
o.datatype = "or(uinteger,portrange)"
418-
o.rmempty = false
420+
o = s:option(Value, "delay", translate("Delay (ms)"))
421+
o.datatype = "or(uinteger,portrange)"
422+
o.rmempty = false
423+
424+
o = s:option(Value, "applyto", translate("ApplyTo (IP type)"))
425+
o.default = "IP"
426+
o:value("IP", "IP")
427+
o:value("IPV4", "IPv4")
428+
o:value("IPV6", "IPv6")
429+
o.rmempty = false
419430
end
420431

421432
return m

luci-app-ssr-plus/po/templates/ssr-plus.pot

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ msgstr ""
6464
msgid "8 Threads"
6565
msgstr ""
6666

67-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:375
67+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:379
6868
msgid "<font style='color:red'>"
6969
msgstr ""
7070

@@ -173,6 +173,10 @@ msgstr ""
173173
msgid "Apply"
174174
msgstr ""
175175

176+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:424
177+
msgid "ApplyTo (IP type)"
178+
msgstr ""
179+
176180
#: applications/luci-app-ssr-plus/luasrc/view/shadowsocksr/backup_restore.htm:133
177181
msgid "Are you sure you want to restore the client to default settings?"
178182
msgstr ""
@@ -313,7 +317,7 @@ msgstr ""
313317
msgid "Click here to view or manage the DNS list file"
314318
msgstr ""
315319

316-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:378
320+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:382
317321
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:833
318322
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua:1138
319323
msgid "Click to the page"
@@ -477,7 +481,7 @@ msgid ""
477481
"fastest_addr (default: load_balance)."
478482
msgstr ""
479483

480-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:416
484+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:420
481485
msgid "Delay (ms)"
482486
msgstr ""
483487

@@ -542,7 +546,7 @@ msgstr ""
542546
msgid "DoT upstream (Need use wolfssl version)"
543547
msgstr ""
544548

545-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:403
549+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:407
546550
msgid "Domain Strategy"
547551
msgstr ""
548552

@@ -568,7 +572,7 @@ msgid "Edit ShadowSocksR Server"
568572
msgstr ""
569573

570574
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:263
571-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:392
575+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:396
572576
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/server-config.lua:82
573577
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/server.lua:101
574578
msgid "Enable"
@@ -741,7 +745,7 @@ msgid ""
741745
"Chinese CDN IP addresses"
742746
msgstr ""
743747

744-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:376
748+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:380
745749
msgid "For specific usage, see:"
746750
msgstr ""
747751

@@ -771,10 +775,18 @@ msgstr ""
771775
msgid "Fragment Packets"
772776
msgstr ""
773777

778+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:370
779+
msgid "Fragment maxSplit"
780+
msgstr ""
781+
774782
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:366
775783
msgid "Fragmentation interval (ms)"
776784
msgstr ""
777785

786+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:370
787+
msgid "Fragmented maxSplit (byte)"
788+
msgstr ""
789+
778790
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:362
779791
msgid "Fragmented packet length (byte)"
780792
msgstr ""
@@ -1223,7 +1235,7 @@ msgstr ""
12231235
msgid "No specify upload file."
12241236
msgstr ""
12251237

1226-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:370
1238+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:374
12271239
msgid "Noise"
12281240
msgstr ""
12291241

@@ -1323,7 +1335,7 @@ msgstr ""
13231335
msgid "Oversea Mode DNS-2 (114.114.115.115)"
13241336
msgstr ""
13251337

1326-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:412
1338+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:416
13271339
msgid "Packet"
13281340
msgstr ""
13291341

@@ -1857,7 +1869,7 @@ msgstr ""
18571869
msgid "Tips: Dnsproxy DNS Parse List Path:"
18581870
msgstr ""
18591871

1860-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:375
1872+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:379
18611873
msgid "To send noise packets, select \"Noise\" in Xray Settings."
18621874
msgstr ""
18631875

@@ -1878,7 +1890,7 @@ msgstr ""
18781890
msgid "Trojan"
18791891
msgstr ""
18801892

1881-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:396
1893+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:400
18821894
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/servers.lua:185
18831895
msgid "Type"
18841896
msgstr ""
@@ -1887,7 +1899,7 @@ msgstr ""
18871899
msgid "UDP"
18881900
msgstr ""
18891901

1890-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:370
1902+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:374
18911903
msgid ""
18921904
"UDP noise, Under some circumstances it can bypass some UDP based protocol "
18931905
"restrictions."
@@ -2160,7 +2172,7 @@ msgstr ""
21602172
msgid "Xray Fragment Settings"
21612173
msgstr ""
21622174

2163-
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:373
2175+
#: applications/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/advanced.lua:377
21642176
msgid "Xray Noise Packets"
21652177
msgstr ""
21662178

0 commit comments

Comments
 (0)