|
@@ -193,6 +193,24 @@ local function processData(szType, content)
|
|
result.splithttp_host = info.host
|
|
result.splithttp_host = info.host
|
|
result.splithttp_path = info.path
|
|
result.splithttp_path = info.path
|
|
end
|
|
end
|
|
|
|
+ if info.net == 'xhttp' then
|
|
|
|
+ result.xhttp_mode = info.mode
|
|
|
|
+ result.xhttp_host = info.host
|
|
|
|
+ result.xhttp_path = info.path
|
|
|
|
+ -- 检查 extra 参数是否存在且非空
|
|
|
|
+ result.enable_xhttp_extra = (info.extra and info.extra ~= "") and "1" or nil
|
|
|
|
+ result.xhttp_extra = (info.extra and info.extra ~= "") and info.extra or nil
|
|
|
|
+ -- 尝试解析 JSON 数据
|
|
|
|
+ local success, Data = pcall(jsonParse, info.extra)
|
|
|
|
+ if success and Data then
|
|
|
|
+ local address = (Data.extra and Data.extra.downloadSettings and Data.extra.downloadSettings.address)
|
|
|
|
+ or (Data.downloadSettings and Data.downloadSettings.address)
|
|
|
|
+ result.download_address = address and address ~= "" and address or nil
|
|
|
|
+ else
|
|
|
|
+ -- 如果解析失败,清空下载地址
|
|
|
|
+ result.download_address = nil
|
|
|
|
+ end
|
|
|
|
+ end
|
|
if info.net == 'h2' then
|
|
if info.net == 'h2' then
|
|
result.h2_host = info.host
|
|
result.h2_host = info.host
|
|
result.h2_path = info.path
|
|
result.h2_path = info.path
|
|
@@ -231,6 +249,9 @@ local function processData(szType, content)
|
|
end
|
|
end
|
|
if info.tls == "tls" or info.tls == "1" then
|
|
if info.tls == "tls" or info.tls == "1" then
|
|
result.tls = "1"
|
|
result.tls = "1"
|
|
|
|
+ if info.alpn and info.alpn ~= "" then
|
|
|
|
+ result.xhttp_alpn = info.alpn
|
|
|
|
+ end
|
|
if info.sni and info.sni ~= "" then
|
|
if info.sni and info.sni ~= "" then
|
|
result.tls_host = info.sni
|
|
result.tls_host = info.sni
|
|
elseif info.host then
|
|
elseif info.host then
|
|
@@ -353,6 +374,11 @@ local function processData(szType, content)
|
|
local t = split(v, '=')
|
|
local t = split(v, '=')
|
|
params[t[1]] = t[2]
|
|
params[t[1]] = t[2]
|
|
end
|
|
end
|
|
|
|
+ if params.alpn then
|
|
|
|
+ -- 处理 alpn 参数
|
|
|
|
+ result.xhttp_alpn = params.alpn
|
|
|
|
+ end
|
|
|
|
+
|
|
if params.sni then
|
|
if params.sni then
|
|
-- 未指定peer(sni)默认使用remote addr
|
|
-- 未指定peer(sni)默认使用remote addr
|
|
result.tls_host = params.sni
|
|
result.tls_host = params.sni
|
|
@@ -385,6 +411,23 @@ local function processData(szType, content)
|
|
elseif result.transport == "splithttp" then
|
|
elseif result.transport == "splithttp" then
|
|
result.splithttp_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
|
result.splithttp_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
|
result.splithttp_path = params.path and UrlDecode(params.path) or "/"
|
|
result.splithttp_path = params.path and UrlDecode(params.path) or "/"
|
|
|
|
+ elseif result.transport == "xhttp" then
|
|
|
|
+ result.xhttp_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
|
|
|
+ result.xhttp_mode = params.mode or "auto"
|
|
|
|
+ result.xhttp_path = params.path and UrlDecode(params.path) or "/"
|
|
|
|
+ -- 检查 extra 参数是否存在且非空
|
|
|
|
+ result.enable_xhttp_extra = (params.extra and params.extra ~= "") and "1" or nil
|
|
|
|
+ result.xhttp_extra = (params.extra and params.extra ~= "") and params.extra or nil
|
|
|
|
+ -- 尝试解析 JSON 数据
|
|
|
|
+ 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)
|
|
|
|
+ or (Data.downloadSettings and Data.downloadSettings.address)
|
|
|
|
+ result.download_address = address and address ~= "" and address or nil
|
|
|
|
+ else
|
|
|
|
+ -- 如果解析失败,清空下载地址
|
|
|
|
+ result.download_address = nil
|
|
|
|
+ end
|
|
elseif result.transport == "http" or result.transport == "h2" then
|
|
elseif result.transport == "http" or result.transport == "h2" then
|
|
result.transport = "h2"
|
|
result.transport = "h2"
|
|
result.h2_host = params.host and UrlDecode(params.host) or nil
|
|
result.h2_host = params.host and UrlDecode(params.host) or nil
|
|
@@ -426,6 +469,7 @@ local function processData(szType, content)
|
|
result.vless_encryption = params.encryption or "none"
|
|
result.vless_encryption = params.encryption or "none"
|
|
result.transport = params.type or "tcp"
|
|
result.transport = params.type or "tcp"
|
|
result.tls = (params.security == "tls" or params.security == "xtls") and "1" or "0"
|
|
result.tls = (params.security == "tls" or params.security == "xtls") and "1" or "0"
|
|
|
|
+ result.xhttp_alpn = params.alpn or ""
|
|
result.tls_host = params.sni
|
|
result.tls_host = params.sni
|
|
result.tls_flow = (params.security == "tls" or params.security == "reality") and params.flow or nil
|
|
result.tls_flow = (params.security == "tls" or params.security == "reality") and params.flow or nil
|
|
result.fingerprint = params.fp
|
|
result.fingerprint = params.fp
|
|
@@ -442,6 +486,23 @@ local function processData(szType, content)
|
|
elseif result.transport == "splithttp" then
|
|
elseif result.transport == "splithttp" then
|
|
result.splithttp_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
|
result.splithttp_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
|
result.splithttp_path = params.path and UrlDecode(params.path) or "/"
|
|
result.splithttp_path = params.path and UrlDecode(params.path) or "/"
|
|
|
|
+ elseif result.transport == "xhttp" then
|
|
|
|
+ result.xhttp_host = (result.tls ~= "1") and (params.host and UrlDecode(params.host)) or nil
|
|
|
|
+ result.xhttp_mode = params.mode or "auto"
|
|
|
|
+ result.xhttp_path = params.path and UrlDecode(params.path) or "/"
|
|
|
|
+ -- 检查 extra 参数是否存在且非空
|
|
|
|
+ result.enable_xhttp_extra = (params.extra and params.extra ~= "") and "1" or nil
|
|
|
|
+ result.xhttp_extra = (params.extra and params.extra ~= "") and params.extra or nil
|
|
|
|
+ -- 尝试解析 JSON 数据
|
|
|
|
+ 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)
|
|
|
|
+ or (Data.downloadSettings and Data.downloadSettings.address)
|
|
|
|
+ result.download_address = address and address ~= "" and address or nil
|
|
|
|
+ else
|
|
|
|
+ -- 如果解析失败,清空下载地址
|
|
|
|
+ result.download_address = nil
|
|
|
|
+ end
|
|
-- make it compatible with bullshit, "h2" transport is non-existent at all
|
|
-- make it compatible with bullshit, "h2" transport is non-existent at all
|
|
elseif result.transport == "http" or result.transport == "h2" then
|
|
elseif result.transport == "http" or result.transport == "h2" then
|
|
result.transport = "h2"
|
|
result.transport = "h2"
|