parent
bf4d7aa8ef
commit
2f64f53745
@ -408,9 +408,19 @@ if singbox_tags:find("with_ech") then
|
||||
o:depends({ [option_name("protocol")] = "hysteria" })
|
||||
o:depends({ [option_name("protocol")] = "hysteria2" })
|
||||
|
||||
o = s:option(Value, option_name("ech_config"), translate("ECH Config"))
|
||||
o = s:option(TextValue, option_name("ech_config"), translate("ECH Config"))
|
||||
o.default = ""
|
||||
o.rows = 5
|
||||
o.wrap = "off"
|
||||
o:depends({ [option_name("ech")] = true })
|
||||
o.validate = function(self, value)
|
||||
value = value:gsub("^%s+", ""):gsub("%s+$","\n"):gsub("\r\n","\n"):gsub("[ \t]*\n[ \t]*", "\n")
|
||||
value = value:gsub("^%s*\n", "")
|
||||
if value:sub(-1) == "\n" then
|
||||
value = value:sub(1, -2)
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
o = s:option(Flag, option_name("pq_signature_schemes_enabled"), translate("PQ signature schemes"))
|
||||
o.default = "0"
|
||||
|
@ -291,9 +291,19 @@ if singbox_tags:find("with_ech") then
|
||||
o:depends({ [option_name("protocol")] = "tuic" })
|
||||
o:depends({ [option_name("protocol")] = "hysteria2" })
|
||||
|
||||
o = s:option(Value, option_name("ech_key"), translate("ECH Key"))
|
||||
o = s:option(TextValue, option_name("ech_key"), translate("ECH Key"))
|
||||
o.default = ""
|
||||
o.rows = 5
|
||||
o.wrap = "off"
|
||||
o:depends({ [option_name("ech")] = true })
|
||||
o.validate = function(self, value)
|
||||
value = value:gsub("^%s+", ""):gsub("%s+$","\n"):gsub("\r\n","\n"):gsub("[ \t]*\n[ \t]*", "\n")
|
||||
value = value:gsub("^%s*\n", "")
|
||||
if value:sub(-1) == "\n" then
|
||||
value = value:sub(1, -2)
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
o = s:option(Flag, option_name("pq_signature_schemes_enabled"), translate("PQ signature schemes"))
|
||||
o.default = "0"
|
||||
|
@ -5,6 +5,7 @@ local sys = api.sys
|
||||
local jsonc = api.jsonc
|
||||
local appname = "passwall"
|
||||
local fs = api.fs
|
||||
local split = api.split
|
||||
|
||||
local new_port
|
||||
|
||||
@ -96,7 +97,7 @@ function gen_outbound(flag, node, tag, proxy_table)
|
||||
--max_version = "1.3",
|
||||
ech = {
|
||||
enabled = (node.ech == "1") and true or false,
|
||||
config = (node.ech_config and node.ech_config:gsub("\\n","\n")) and node.ech_config:gsub("\\n","\n") or nil,
|
||||
config = node.ech_config and split(node.ech_config:gsub("\\n", "\n"), "\n") or {},
|
||||
pq_signature_schemes_enabled = node.pq_signature_schemes_enabled and true or false,
|
||||
dynamic_record_sizing_disabled = node.dynamic_record_sizing_disabled and true or false
|
||||
},
|
||||
@ -306,7 +307,7 @@ function gen_outbound(flag, node, tag, proxy_table)
|
||||
} or nil,
|
||||
ech = {
|
||||
enabled = (node.ech == "1") and true or false,
|
||||
config = (node.ech_config and node.ech_config:gsub("\\n","\n")) and node.ech_config:gsub("\\n","\n") or nil,
|
||||
config = node.ech_config and split(node.ech_config:gsub("\\n", "\n"), "\n") or {},
|
||||
pq_signature_schemes_enabled = node.pq_signature_schemes_enabled and true or false,
|
||||
dynamic_record_sizing_disabled = node.dynamic_record_sizing_disabled and true or false
|
||||
}
|
||||
@ -340,7 +341,7 @@ function gen_outbound(flag, node, tag, proxy_table)
|
||||
} or nil,
|
||||
ech = {
|
||||
enabled = (node.ech == "1") and true or false,
|
||||
config = (node.ech_config and node.ech_config:gsub("\\n","\n")) and node.ech_config:gsub("\\n","\n") or nil,
|
||||
config = node.ech_config and split(node.ech_config:gsub("\\n", "\n"), "\n") or {},
|
||||
pq_signature_schemes_enabled = node.pq_signature_schemes_enabled and true or false,
|
||||
dynamic_record_sizing_disabled = node.dynamic_record_sizing_disabled and true or false
|
||||
}
|
||||
@ -363,7 +364,7 @@ function gen_outbound(flag, node, tag, proxy_table)
|
||||
insecure = (node.tls_allowInsecure == "1") and true or false,
|
||||
ech = {
|
||||
enabled = (node.ech == "1") and true or false,
|
||||
config = (node.ech_config and node.ech_config:gsub("\\n","\n")) and node.ech_config:gsub("\\n","\n") or nil,
|
||||
config = node.ech_config and split(node.ech_config:gsub("\\n", "\n"), "\n") or {},
|
||||
pq_signature_schemes_enabled = node.pq_signature_schemes_enabled and true or false,
|
||||
dynamic_record_sizing_disabled = node.dynamic_record_sizing_disabled and true or false
|
||||
}
|
||||
@ -411,7 +412,7 @@ function gen_config_server(node)
|
||||
if node.tls == "1" and node.ech == "1" then
|
||||
tls.ech = {
|
||||
enabled = true,
|
||||
key = (node.ech_key and node.ech_key:gsub("\\n","\n")) and node.ech_key:gsub("\\n","\n") or nil,
|
||||
key = node.ech_key and split(node.ech_key:gsub("\\n", "\n"), "\n") or {},
|
||||
pq_signature_schemes_enabled = (node.pq_signature_schemes_enabled == "1") and true or false,
|
||||
dynamic_record_sizing_disabled = (node.dynamic_record_sizing_disabled == "1") and true or false,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user