parent
e9f8d235e2
commit
9bc1b75cf3
@ -11,7 +11,7 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
|
|||||||
-%>
|
-%>
|
||||||
<script src="<%=resource%>/qrcode.min.js"></script>
|
<script src="<%=resource%>/qrcode.min.js"></script>
|
||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
let has_singbox = "<%=api.finded_com("singbox")%>"
|
let has_singbox = "<%=api.finded_com("sing-box")%>"
|
||||||
let has_xray = "<%=api.finded_com("xray")%>"
|
let has_xray = "<%=api.finded_com("xray")%>"
|
||||||
let has_hysteria2 = "<%=api.finded_com("hysteria")%>"
|
let has_hysteria2 = "<%=api.finded_com("hysteria")%>"
|
||||||
let ss_type = "<%=ss_type%>"
|
let ss_type = "<%=ss_type%>"
|
||||||
@ -511,6 +511,10 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
|
|||||||
params += "&obfs=" + "salamander";
|
params += "&obfs=" + "salamander";
|
||||||
params += opt.query("obfs-password", "hysteria2_obfs");
|
params += opt.query("obfs-password", "hysteria2_obfs");
|
||||||
}
|
}
|
||||||
|
var dom_ports = opt.get(dom_prefix + "hop");
|
||||||
|
if (dom_ports && dom_ports.value != "") {
|
||||||
|
params += opt.query("mport", dom_prefix + "hop");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
v_password = opt.get(dom_prefix + "hysteria2_auth_password");
|
v_password = opt.get(dom_prefix + "hysteria2_auth_password");
|
||||||
var dom_obfs_type = opt.get(dom_prefix + "hysteria2_obfs_type");
|
var dom_obfs_type = opt.get(dom_prefix + "hysteria2_obfs_type");
|
||||||
@ -518,7 +522,12 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
|
|||||||
params += opt.query("obfs", dom_prefix + "hysteria2_obfs_type");
|
params += opt.query("obfs", dom_prefix + "hysteria2_obfs_type");
|
||||||
params += opt.query("obfs-password", dom_prefix + "hysteria2_obfs_password");
|
params += opt.query("obfs-password", dom_prefix + "hysteria2_obfs_password");
|
||||||
}
|
}
|
||||||
|
var dom_ports = opt.get(dom_prefix + "hysteria2_ports");
|
||||||
|
if (dom_ports && dom_ports.value != "") {
|
||||||
|
params += opt.query("mport", dom_prefix + "hysteria2_ports");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
params = params.replace(/^&/, "");
|
||||||
url =
|
url =
|
||||||
_address + ":" +
|
_address + ":" +
|
||||||
v_port.value + "?" +
|
v_port.value + "?" +
|
||||||
@ -1306,6 +1315,7 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
|
|||||||
opt.set(dom_prefix + 'hysteria2_obfs_type', "salamander");
|
opt.set(dom_prefix + 'hysteria2_obfs_type', "salamander");
|
||||||
opt.set(dom_prefix + 'hysteria2_obfs_password', queryParam["obfs-password"]);
|
opt.set(dom_prefix + 'hysteria2_obfs_password', queryParam["obfs-password"]);
|
||||||
}
|
}
|
||||||
|
opt.set(dom_prefix + 'hysteria2_ports', queryParam.mport || "");
|
||||||
} else if (has_hysteria2) {
|
} else if (has_hysteria2) {
|
||||||
opt.set('type', "Hysteria2");
|
opt.set('type', "Hysteria2");
|
||||||
dom_prefix = "hysteria2_"
|
dom_prefix = "hysteria2_"
|
||||||
@ -1316,12 +1326,13 @@ local hysteria2_type = map:get("@global_subscribe[0]", "hysteria2_type") or "sin
|
|||||||
if (queryParam.pinSHA256) {
|
if (queryParam.pinSHA256) {
|
||||||
opt.set(dom_prefix + 'tls_pinSHA256', queryParam.pinSHA256);
|
opt.set(dom_prefix + 'tls_pinSHA256', queryParam.pinSHA256);
|
||||||
}
|
}
|
||||||
|
opt.set(dom_prefix + 'hop', queryParam.mport || "");
|
||||||
}
|
}
|
||||||
|
|
||||||
opt.set(dom_prefix + 'address', m.hostname);
|
opt.set(dom_prefix + 'address', m.hostname);
|
||||||
opt.set(dom_prefix + 'port', m.port || "443");
|
opt.set(dom_prefix + 'port', m.port || "443");
|
||||||
|
|
||||||
opt.set(dom_prefix + 'tls_serverName', queryParam.sni);
|
opt.set(dom_prefix + 'tls_serverName', queryParam.sni || "");
|
||||||
if (queryParam.insecure && queryParam.insecure == "1") {
|
if (queryParam.insecure && queryParam.insecure == "1") {
|
||||||
opt.set(dom_prefix + 'tls_allowInsecure', true);
|
opt.set(dom_prefix + 'tls_allowInsecure', true);
|
||||||
}
|
}
|
||||||
|
@ -1223,12 +1223,6 @@ local function processData(szType, content, add_mode, add_from)
|
|||||||
end
|
end
|
||||||
result.hysteria2_tls_pinSHA256 = params.pinSHA256
|
result.hysteria2_tls_pinSHA256 = params.pinSHA256
|
||||||
|
|
||||||
if has_hysteria2 then
|
|
||||||
result.type = "Hysteria2"
|
|
||||||
if params["obfs-password"] then
|
|
||||||
result.hysteria2_obfs = params["obfs-password"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if hysteria2_type_default == "sing-box" and has_singbox then
|
if hysteria2_type_default == "sing-box" and has_singbox then
|
||||||
result.type = 'sing-box'
|
result.type = 'sing-box'
|
||||||
result.protocol = "hysteria2"
|
result.protocol = "hysteria2"
|
||||||
@ -1236,6 +1230,13 @@ local function processData(szType, content, add_mode, add_from)
|
|||||||
result.hysteria2_obfs_type = "salamander"
|
result.hysteria2_obfs_type = "salamander"
|
||||||
result.hysteria2_obfs_password = params["obfs-password"]
|
result.hysteria2_obfs_password = params["obfs-password"]
|
||||||
end
|
end
|
||||||
|
result.hysteria2_ports = params.mport
|
||||||
|
elseif has_hysteria2 then
|
||||||
|
result.type = "Hysteria2"
|
||||||
|
if params["obfs-password"] then
|
||||||
|
result.hysteria2_obfs = params["obfs-password"]
|
||||||
|
end
|
||||||
|
result.hysteria2_hop = params.mport
|
||||||
end
|
end
|
||||||
elseif szType == 'tuic' then
|
elseif szType == 'tuic' then
|
||||||
local alias = ""
|
local alias = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user