luci: add Xray VLESS share link fp

This commit is contained in:
xiaorouji 2023-02-04 16:39:36 +08:00 committed by sbwml
parent 28d52193ac
commit ca32b91815
2 changed files with 15 additions and 8 deletions

View File

@ -287,14 +287,17 @@ local has_xray = api.is_finded("xray")
params += opt.query("encryption", "encryption"); params += opt.query("encryption", "encryption");
if (opt.get("tls").checked) { if (opt.get("tls").checked) {
var v_security = "tls"; var v_security = "tls";
var v_flow = null; params += "&security=" + v_security;
params += "&security=" + v_security; if (opt.get("tlsflow").value) {
if (opt.get("tlsflow").value) { let v_flow = opt.get("tlsflow").value;
v_flow = opt.get("tlsflow").value; params += "&flow=" + v_flow;
params += "&flow=" + v_flow; }
} if (opt.get("xray_fingerprint").value && opt.get("xray_fingerprint").value != "") {
params += opt.query("sni", "tls_serverName"); let v_fp = opt.get("xray_fingerprint").value
params += "&fp=" + v_fp;
}
params += opt.query("sni", "tls_serverName");
} }
params += "#" + encodeURI(v_alias.value); params += "#" + encodeURI(v_alias.value);
@ -857,6 +860,9 @@ local has_xray = api.is_finded("xray")
if (queryParam.allowinsecure === '0') { if (queryParam.allowinsecure === '0') {
opt.set('tls_allowInsecure', false); opt.set('tls_allowInsecure', false);
} }
if (queryParam.fp && queryParam.fp.trim() != "") {
opt.set('xray_fingerprint', queryParam.fp);
}
} }
} }

View File

@ -775,6 +775,7 @@ local function processData(szType, content, add_mode, add_from)
result.tls = "1" result.tls = "1"
result.tlsflow = params.flow or nil result.tlsflow = params.flow or nil
result.tls_serverName = (params.sni and params.sni ~= "") and params.sni or params.host result.tls_serverName = (params.sni and params.sni ~= "") and params.sni or params.host
result.fingerprint = (params.fp and params.fp ~= "") and params.fp or nil
end end
result.port = port result.port = port