parent
d12bc028d2
commit
030a77dd93
@ -495,6 +495,10 @@ o = s:option(Value, option_name("ws_path"), translate("WebSocket Path"))
|
|||||||
o.placeholder = "/"
|
o.placeholder = "/"
|
||||||
o:depends({ [option_name("transport")] = "ws" })
|
o:depends({ [option_name("transport")] = "ws" })
|
||||||
|
|
||||||
|
o = s:option(Value, option_name("ws_heartbeatPeriod"), translate("HeartbeatPeriod(second)"))
|
||||||
|
o.datatype = "integer"
|
||||||
|
o:depends({ [option_name("transport")] = "ws" })
|
||||||
|
|
||||||
-- [[ HTTP/2部分 ]]--
|
-- [[ HTTP/2部分 ]]--
|
||||||
o = s:option(Value, option_name("h2_host"), translate("HTTP/2 Host"))
|
o = s:option(Value, option_name("h2_host"), translate("HTTP/2 Host"))
|
||||||
o:depends({ [option_name("transport")] = "h2" })
|
o:depends({ [option_name("transport")] = "h2" })
|
||||||
@ -575,6 +579,7 @@ o.default = "auto"
|
|||||||
o:value("auto")
|
o:value("auto")
|
||||||
o:value("packet-up")
|
o:value("packet-up")
|
||||||
o:value("stream-up")
|
o:value("stream-up")
|
||||||
|
o:value("stream-one")
|
||||||
|
|
||||||
o = s:option(Value, option_name("xhttp_host"), translate("XHTTP Host"))
|
o = s:option(Value, option_name("xhttp_host"), translate("XHTTP Host"))
|
||||||
o:depends({ [option_name("transport")] = "xhttp" })
|
o:depends({ [option_name("transport")] = "xhttp" })
|
||||||
@ -588,12 +593,18 @@ o:depends({ [option_name("transport")] = "xhttp" })
|
|||||||
o.rows = 15
|
o.rows = 15
|
||||||
o.wrap = "off"
|
o.wrap = "off"
|
||||||
o.custom_write = function(self, section, value)
|
o.custom_write = function(self, section, value)
|
||||||
|
|
||||||
m:set(section, self.option:sub(1 + #option_prefix), value)
|
m:set(section, self.option:sub(1 + #option_prefix), value)
|
||||||
local data = value and value ~= "" and jsonc.parse(value)
|
|
||||||
local address = (data and data.extra and data.extra.downloadSettings and data.extra.downloadSettings.address)
|
local success, data = pcall(jsonc.parse, value)
|
||||||
or (data and data.downloadSettings and data.downloadSettings.address)
|
if success and data then
|
||||||
if address and address ~= "" then
|
local address = (data.extra and data.extra.downloadSettings and data.extra.downloadSettings.address)
|
||||||
m:set(section, "download_address", address)
|
or (data.downloadSettings and data.downloadSettings.address)
|
||||||
|
if address and address ~= "" then
|
||||||
|
m:set(section, "download_address", address)
|
||||||
|
else
|
||||||
|
m:del(section, "download_address")
|
||||||
|
end
|
||||||
else
|
else
|
||||||
m:del(section, "download_address")
|
m:del(section, "download_address")
|
||||||
end
|
end
|
||||||
|
@ -189,7 +189,8 @@ function gen_outbound(flag, node, tag, proxy_table)
|
|||||||
headers = (node.ws_host ~= nil) and
|
headers = (node.ws_host ~= nil) and
|
||||||
{Host = node.ws_host} or nil,
|
{Host = node.ws_host} or nil,
|
||||||
maxEarlyData = tonumber(node.ws_maxEarlyData) or nil,
|
maxEarlyData = tonumber(node.ws_maxEarlyData) or nil,
|
||||||
earlyDataHeaderName = (node.ws_earlyDataHeaderName) and node.ws_earlyDataHeaderName or nil
|
earlyDataHeaderName = (node.ws_earlyDataHeaderName) and node.ws_earlyDataHeaderName or nil,
|
||||||
|
heartbeatPeriod = tonumber(node.ws_heartbeatPeriod) or nil
|
||||||
} or nil,
|
} or nil,
|
||||||
httpSettings = (node.transport == "h2") and {
|
httpSettings = (node.transport == "h2") and {
|
||||||
path = node.h2_path or "/",
|
path = node.h2_path or "/",
|
||||||
@ -221,7 +222,14 @@ function gen_outbound(flag, node, tag, proxy_table)
|
|||||||
path = node.xhttp_path or node.splithttp_path or "/",
|
path = node.xhttp_path or node.splithttp_path or "/",
|
||||||
host = node.xhttp_host or node.splithttp_host,
|
host = node.xhttp_host or node.splithttp_host,
|
||||||
-- 如果包含 "extra" 节,取 "extra" 内的内容,否则直接赋值给 extra
|
-- 如果包含 "extra" 节,取 "extra" 内的内容,否则直接赋值给 extra
|
||||||
extra = node.xhttp_extra and (jsonc.parse(node.xhttp_extra).extra or jsonc.parse(node.xhttp_extra)) or nil
|
extra = node.xhttp_extra and (function()
|
||||||
|
local success, parsed = pcall(jsonc.parse, node.xhttp_extra)
|
||||||
|
if success then
|
||||||
|
return parsed.extra or parsed
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end)() or nil
|
||||||
} or nil,
|
} or nil,
|
||||||
} or nil,
|
} or nil,
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -1609,6 +1609,9 @@ msgstr "端口跳跃时间 "
|
|||||||
msgid "Additional ports for hysteria hop"
|
msgid "Additional ports for hysteria hop"
|
||||||
msgstr "端口跳跃额外端口"
|
msgstr "端口跳跃额外端口"
|
||||||
|
|
||||||
|
msgid "HeartbeatPeriod(second)"
|
||||||
|
msgstr "心跳周期(单位:秒)"
|
||||||
|
|
||||||
msgid "Custom geoip Path"
|
msgid "Custom geoip Path"
|
||||||
msgstr "自定义 geoip 文件路径"
|
msgstr "自定义 geoip 文件路径"
|
||||||
|
|
||||||
|
@ -1000,10 +1000,14 @@ local function processData(szType, content, add_mode, add_from)
|
|||||||
result.xhttp_path = params.path
|
result.xhttp_path = params.path
|
||||||
result.xhttp_mode = params.mode or "auto"
|
result.xhttp_mode = params.mode or "auto"
|
||||||
result.xhttp_extra = params.extra
|
result.xhttp_extra = params.extra
|
||||||
local Data = params.extra and params.extra ~= "" and jsonParse(params.extra)
|
local success, Data = pcall(jsonParse, params.extra)
|
||||||
local address = (Data and Data.extra and Data.extra.downloadSettings and Data.extra.downloadSettings.address)
|
if success and Data then
|
||||||
or (Data and Data.downloadSettings and Data.downloadSettings.address)
|
local address = (Data.extra and Data.extra.downloadSettings and Data.extra.downloadSettings.address)
|
||||||
result.download_address = address and address ~= "" and address or nil
|
or (Data.downloadSettings and Data.downloadSettings.address)
|
||||||
|
result.download_address = address and address ~= "" and address or nil
|
||||||
|
else
|
||||||
|
result.download_address = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if params.type == 'httpupgrade' then
|
if params.type == 'httpupgrade' then
|
||||||
result.httpupgrade_host = params.host
|
result.httpupgrade_host = params.host
|
||||||
|
Loading…
Reference in New Issue
Block a user