mirror of
https://github.com/KOP-XIAO/QuantumultX.git
synced 2026-01-26 09:55:09 +00:00
minor bug fixed
This commit is contained in:
@@ -1514,30 +1514,30 @@ function SSR2QX(subs, Pudp, Ptfo) {
|
|||||||
|
|
||||||
//Trojan 类型 URI 转换成 QX
|
//Trojan 类型 URI 转换成 QX
|
||||||
function TJ2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
|
function TJ2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
|
||||||
var ntrojan = []
|
var ntrojan = []
|
||||||
var cnt = subs.split("trojan://")[1]
|
var cnt = subs.split("trojan://")[1]
|
||||||
type = "trojan=";
|
type = "trojan=";
|
||||||
if (cnt.indexOf(":443") != -1) {
|
if (cnt.indexOf(":443") != -1) {
|
||||||
ip = cnt.split("@")[1].split(":443")[0] + ":443";
|
ip = cnt.split("@")[1].split(":443")[0] + ":443";
|
||||||
} else {
|
} else {
|
||||||
ip = cnt.split("@")[1].split("?")[0].split("\n")[0].trim(); //非 443 端口的奇葩机场?
|
ip = cnt.split("@")[1].split("?")[0].split("\n")[0].split("#")[0].trim(); //非 443 端口的奇葩机场?
|
||||||
}
|
}
|
||||||
pwd = "password=" + cnt.split("@")[0];
|
pwd = cnt.split("@")[0]? "password=" + decodeURIComponent(cnt.split("@")[0]):"";
|
||||||
obfs = "over-tls=true";
|
obfs = "over-tls=true";
|
||||||
pcert = cnt.indexOf("allowInsecure=0") != -1 ? "tls-verification=true" : "tls-verification=false";
|
pcert = cnt.indexOf("allowInsecure=0") != -1 ? "tls-verification=true" : "tls-verification=false";
|
||||||
thost = cnt.indexOf("sni=") != -1? "tls-host="+cnt.split("sni=")[1].split(/&|#/)[0]:""
|
thost = cnt.indexOf("sni=") != -1? "tls-host="+cnt.split("sni=")[1].split(/&|#/)[0]:""
|
||||||
ptls13 = PTls13 == 1 ? "tls13=true" : "tls13=false"
|
ptls13 = PTls13 == 1 ? "tls13=true" : "tls13=false"
|
||||||
if (Pcert0 == 0) {
|
if (Pcert0 == 0) {
|
||||||
pcert = "tls-verification=false"
|
pcert = "tls-verification=false"
|
||||||
} else if (Pcert0 == 1) {
|
} else if (Pcert0 == 1) {
|
||||||
pcert = "tls-verification=true"
|
pcert = "tls-verification=true"
|
||||||
}
|
}
|
||||||
pudp = Pudp == 1 ? "udp-relay=false" : "udp-relay=false";
|
pudp = Pudp == 1 ? "udp-relay=false" : "udp-relay=false";
|
||||||
ptfo = Ptfo == 1 ? "fast-open=true" : "fast-open=false";
|
ptfo = Ptfo == 1 ? "fast-open=true" : "fast-open=false";
|
||||||
tag = cnt.indexOf("#") != -1 ? "tag=" + decodeURIComponent(cnt.split("#")[1]) : "tag= [trojan]" + ip
|
tag = cnt.indexOf("#") != -1 ? "tag=" + decodeURIComponent(cnt.split("#")[1]) : "tag= [trojan]" + ip
|
||||||
ntrojan.push(type + ip, pwd, obfs, pcert, thost, ptls13, pudp, ptfo, tag)
|
ntrojan.push(type + ip, pwd, obfs, pcert, thost, ptls13, pudp, ptfo, tag)
|
||||||
QX = ntrojan.filter(Boolean).join(", ");
|
QX = ntrojan.filter(Boolean).join(", ");
|
||||||
return QX;
|
return QX;
|
||||||
}
|
}
|
||||||
|
|
||||||
//SS 类型 URI 转换 quanx 格式
|
//SS 类型 URI 转换 quanx 格式
|
||||||
|
|||||||
Reference in New Issue
Block a user