From 401548753b38195038b50ea99552b8a33339af75 Mon Sep 17 00:00:00 2001 From: bowhorse <160450443+bowhorse@users.noreply.github.com> Date: Mon, 19 Feb 2024 01:47:06 -0200 Subject: [PATCH] luci: Add Xray fragment front-end options "Some key-value pair configuration items are used to control outgoing TCP fragments, which can deceive the censorship system in some cases, such as bypassing SNI blacklists." -"packets": Supports two slicing methods. "1-3" is TCP's stream slicing, which is applied to the client's 1st to 3rd time writing data. "tlshello" is the TLS handshake packet slice. -"length": Fragmented packet length (byte) -"interval": Fragmentation interval (ms) https://xtls.github.io/config/outbounds/freedom.html#outboundconfigurationobject --- .../luasrc/model/cbi/passwall/client/other.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua index 07aba526c..4ac1c9e25 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua @@ -155,6 +155,23 @@ if has_xray then s_xray.anonymous = true s_xray.addremove = false + o = s_xray:option(Flag, "fragment", translate("Fragment"), translate("TCP fragments, which can deceive the censorship system in some cases, such as bypassing SNI blacklists.")) + o.default = 0 + + o = s_xray: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.")) + o.default = "tlshello" + o:value("1-3", "1-3") + o:value("tlshello", "tlshello") + o:depends("fragment", true) + + o = s_xray:option(Value, "fragment_length", translate("Fragment Length"), translate("Fragmented packet length (byte)")) + o.default = "10-20" + o:depends("fragment", true) + + o = s_xray:option(Value, "fragment_interval", translate("Fragment Interval"), translate("Fragmentation interval (ms)")) + o.default = "10-20" + o:depends("fragment", true) + o = s_xray:option(Flag, "sniffing", translate("Sniffing"), translate("When using the shunt, must be enabled, otherwise the shunt will invalid.")) o.default = 1 o.rmempty = false