update 2025-01-12 20:36:19
This commit is contained in:
parent
3b604e1f43
commit
3b23f9b9d5
|
@ -566,8 +566,12 @@ o = s:option(Value, _n("xhttp_path"), translate("XHTTP Path"))
|
|||
o.placeholder = "/"
|
||||
o:depends({ [_n("transport")] = "xhttp" })
|
||||
|
||||
o = s:option(TextValue, _n("xhttp_extra"), translate("XHTTP Extra"), translate("An XHttpObject in JSON format, used for sharing."))
|
||||
o = s:option(Flag, _n("use_xhttp_extra"), translate("XHTTP Extra"))
|
||||
o.default = "0"
|
||||
o:depends({ [_n("transport")] = "xhttp" })
|
||||
|
||||
o = s:option(TextValue, _n("xhttp_extra"), " ", translate("An XHttpObject in JSON format, used for sharing."))
|
||||
o:depends({ [_n("use_xhttp_extra")] = true })
|
||||
o.rows = 15
|
||||
o.wrap = "off"
|
||||
o.custom_write = function(self, section, value)
|
||||
|
|
|
@ -383,7 +383,9 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
|
|||
params += opt.query("host", dom_prefix + "xhttp_host");
|
||||
params += opt.query("path", dom_prefix + "xhttp_path");
|
||||
params += opt.query("mode", dom_prefix + "xhttp_mode");
|
||||
params += opt.query("extra", dom_prefix + "xhttp_extra");
|
||||
if (opt.get(dom_prefix + "use_xhttp_extra").checked) {
|
||||
params += opt.query("extra", dom_prefix + "xhttp_extra");
|
||||
}
|
||||
} else if (v_transport === "httpupgrade") {
|
||||
v_transport = "httpupgrade";
|
||||
params += opt.query("host", dom_prefix + "httpupgrade_host");
|
||||
|
@ -1266,6 +1268,7 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
|
|||
opt.set(dom_prefix + 'xhttp_host', queryParam.host || "");
|
||||
opt.set(dom_prefix + 'xhttp_path', queryParam.path || "");
|
||||
opt.set(dom_prefix + 'xhttp_mode', queryParam.mode || "auto");
|
||||
opt.set(dom_prefix + 'use_xhttp_extra', !!queryParam.extra);
|
||||
opt.set(dom_prefix + 'xhttp_extra', queryParam.extra || "");
|
||||
} else if (queryParam.type === "httpupgrade") {
|
||||
opt.set(dom_prefix + 'httpupgrade_host', queryParam.host || "");
|
||||
|
|
|
@ -1054,7 +1054,8 @@ local function processData(szType, content, add_mode, add_from)
|
|||
result.xhttp_host = params.host
|
||||
result.xhttp_path = params.path
|
||||
result.xhttp_mode = params.mode or "auto"
|
||||
result.xhttp_extra = params.extra
|
||||
result.use_xhttp_extra = (params.extra and params.extra ~= "") and "1" or nil
|
||||
result.xhttp_extra = (params.extra and params.extra ~= "") and params.extra or nil
|
||||
local success, Data = pcall(jsonParse, params.extra)
|
||||
if success and Data then
|
||||
local address = (Data.extra and Data.extra.downloadSettings and Data.extra.downloadSettings.address)
|
||||
|
|
Loading…
Reference in New Issue