luci: add compatible option to sing-box VMess

This commit is contained in:
xiaorouji 2023-09-11 01:14:03 +08:00 committed by sbwml
parent 4e720fa28d
commit ca0389bd38
4 changed files with 23 additions and 3 deletions

View File

@ -252,6 +252,19 @@ o:depends({ [option_name("protocol")] = "vmess" })
o:depends({ [option_name("protocol")] = "vless" })
o:depends({ [option_name("protocol")] = "tuic" })
o = s:option(Value, option_name("alter_id"), "Alter ID")
o.datatype = "uinteger"
o.default = "0"
o:depends({ [option_name("protocol")] = "vmess" })
o = s:option(Flag, option_name("global_padding"), "global_padding", translate("Protocol parameter. Will waste traffic randomly if enabled."))
o.default = "0"
o:depends({ [option_name("protocol")] = "vmess" })
o = s:option(Flag, option_name("authenticated_length"), "authenticated_length", translate("Protocol parameter. Enable length block encryption."))
o.default = "0"
o:depends({ [option_name("protocol")] = "vmess" })
o = s:option(ListValue, option_name("flow"), translate("flow"))
o.default = ""
o:value("", translate("Disable"))

View File

@ -216,9 +216,9 @@ function gen_outbound(flag, node, tag, proxy_table)
protocol_table = {
uuid = node.uuid,
security = node.security,
alter_id = 0,
global_padding = false,
authenticated_length = true,
alter_id = (node.alter_id) and tonumber(node.alter_id) or 0,
global_padding = (node.global_padding == "1") and true or false,
authenticated_length = (node.authenticated_length == "1") and true or false,
tls = tls,
packet_encoding = "", --UDP 包编码。(空):禁用 packetaddr由 v2ray 5+ 支持 xudp由 xray 支持
multiplex = mux,

View File

@ -1488,3 +1488,9 @@ msgstr "覆盖连接目标地址"
msgid "Override the connection destination address with the sniffed domain."
msgstr "用探测出的域名覆盖连接目标地址。"
msgid "Protocol parameter. Will waste traffic randomly if enabled."
msgstr "协议参数。 如果启用会随机浪费流量。"
msgid "Protocol parameter. Enable length block encryption."
msgstr "协议参数。启用长度块加密。"

View File

@ -400,6 +400,7 @@ local function processData(szType, content, add_mode, add_from)
elseif has_xray then
result.type = 'Xray'
end
result.alter_id = info.aid
result.address = info.add
result.port = info.port
result.protocol = 'vmess'