This commit is contained in:
Shawn
2020-09-01 03:41:33 +08:00
parent 27011620e3
commit 4159e5887d

View File

@@ -1,5 +1,5 @@
/**
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2020-08-31 23:29⟧
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2020-09-01 06:29⟧
----------------------------------------------------------
🛠 发现 𝐁𝐔𝐆 请反馈: @Shawn_KOP_bot
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
@@ -284,7 +284,7 @@ function Type_Check(subs) {
var ClashK = ["proxies:"]
var SubK = ["dm1lc3M", "c3NyOi8v", "dHJvamFu", "c3M6Ly", "c3NkOi8v", "c2hhZG93"];
var RewriteK = [" url "]
var SubK2 = ["ss://", "vmess://", "ssr://", "trojan://", "ssd://", "https://"];
var SubK2 = ["ss://", "vmess://", "ssr://", "trojan://", "ssd://"];
var html = "DOCTYPE html"
var subi = subs.replace(/ /g, "")
const RuleCheck = (item) => subi.toLowerCase().indexOf(item) != -1;
@@ -802,24 +802,25 @@ function Subs2QX(subs, Pudp, Ptfo, Pcert, Ptls13) {
return QXlist
}
//https://username:password@IP:PORT#name
//http=example.com:443, username=name, password=pwd, over-tls=true, tls-host=example.com, tls-verification=true, tls13=true, fast-open=false, udp-relay=false, tag=http-tls-02
//HTTPS 类型 URI 转换成 QUANX 格式
function HPS2QX(subs, Ptfo, Pcert, Ptls13) {
var server = Base64.decode(subs.replace("https://", "")).trim().split("\u0000")[0];
var nss = []
if (server != "") {
var ipport = "http=" + server.split("@")[1].split("#")[0].split("/")[0];
var uname = "username=" + server.split(":")[0];
var pwd = "password=" + server.split("@")[0].split(":")[1];
var tag = "tag=" + server.split("#")[1];
var tls = "over-tls=true";
var cert = Pcert != 0 ? "tls-verification=true" : "tls-verification=false";
var tfo = Ptfo == 1 ? "fast-open=true" : "fast-open=false";
var tls13 = Ptls13 == 1 ? "tls13=true" : "tls13=false";
nss.push(ipport, uname, pwd, tls, cert, tfo, tls13, tag)
}
var QX = nss.join(",");
return QX
var server = Base64.decode(subs.split("@")[0].replace("https://", "")).trim().split("\u0000")[0];
var nss = []
if (server != "") {
var ipport = "http=" + server.split("@")[1].split("#")[0].split("/")[0];
var uname = "username=" + server.split(":")[0];
var pwd = "password=" + server.split("@")[0].split(":")[1];
var tag = "tag=" + server.split("#")[1];
var tls = "over-tls=true";
var cert = Pcert != 0 ? "tls-verification=true" : "tls-verification=false";
var tfo = Ptfo == 1 ? "fast-open=true" : "fast-open=false";
var tls13 = Ptls13 == 1 ? "tls13=true" : "tls13=false";
nss.push(ipport, uname, pwd, tls, cert, tfo, tls13, tag)
}
var QX = nss.join(",");
return QX
}
//quantumult 格式的 vmess URI 转换