MCPcopy Index your code
hub / github.com/Moli-X/Resources / V2QX

Function V2QX

Script/Parser.js:1732–1761  ·  view source on GitHub ↗
(subs, Pudp, Ptfo, Pcert0, PTls13)

Source from the content-addressed store, hash-verified

1730
1731//V2RayN uri转换成 QUANX 格式
1732function V2QX(subs, Pudp, Ptfo, Pcert0, PTls13) {
1733 //console.log("v2 type",subs)
1734 var cert = Pcert0
1735 var tls13 = PTls13
1736 var server = String(Base64.decode(subs.replace("vmess://", "")).trim()).split("\u0000")[0];
1737 var nss = [];
1738 if (server != "") {
1739 ss = JSON.parse(server);
1740 if(Pdbg) {$notify("Vmess-URI","",JSON.stringify(ss))}
1741 ip = "vmess=" + ss.add + ":" + ss.port;
1742 pwd = "password=" + ss.id;
1743 mtd = "method=aes-128-gcm"
1744 try {
1745 tag = "tag=" + decodeURIComponent(ss.ps);
1746 } catch (e) {
1747 tag = "tag=" + ss.ps;
1748 }
1749 udp = Pudp == 1 ? "udp-relay=false" : "udp-relay=false";
1750 tfo = Ptfo == 1 ? "fast-open=true" : "fast-open=false";
1751 obfs = Fobfs(ss, cert, tls13);
1752 caead = ss.aid && ss.aid != "0" ? "aead=false" : "aead=true"; //aead 选项
1753 if (obfs == "" || obfs == undefined) {
1754 nss.push(ip, mtd, pwd, tfo, udp, caead, tag)
1755 } else if(obfs != "NOT-SUPPORTTED"){
1756 nss.push(ip, mtd, pwd, obfs, tfo, udp, caead, tag);
1757 }
1758 QX = nss.join(", ");
1759 }
1760 return QX
1761}
1762
1763// Vmess obfs 参数
1764function Fobfs(jsonl, Pcert0, PTls13) {

Callers 1

Subs2QXFunction · 0.85

Calls 6

FobfsFunction · 0.85
$notifyFunction · 0.70
parseMethod · 0.45
stringifyMethod · 0.45
pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…