MCPcopy Create free account
hub / github.com/Moli-X/Resources / SSS2QX

Function SSS2QX

Script/Parser.js:2527–2544  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

2525
2526// surge3 中的 SS 类型
2527function SSS2QX(content) {
2528 var cnt = content;
2529 var tag = "tag=" + cnt.split("=")[0].trim();
2530 var ipport = cnt.split(",")[1].trim() + ":" + cnt.split(",")[2].trim();
2531 var pmtd = "method=" + cnt.split("encrypt-method")[1].split(",")[0].split("=")[1];
2532 var pwd = "password=" + cnt.split("password")[1].split(",")[0].split("=")[1];
2533 if (cnt.indexOf("obfs") != -1) {
2534 pobfs = "obfs=" + cnt.replace(/obfs-host/, "").split("obfs")[1].split(",")[0].split("=")[1]
2535 } else { pobfs = "" }
2536 var phost = cnt.indexOf("obfs-host") != -1 ? "obfs-host" + cnt.split("obfs-host")[1].split(",")[0].trim() : "";
2537 if (phost != "") {
2538 pobfs = pobfs + ", " + phost
2539 }
2540 var ptfo = paraCheck(cnt, "tfo") == "true" ? "fast-open=true" : "fast-open=false";
2541 var pudp = paraCheck(cnt, "udp-relay") == "true" ? "udp-relay=true" : "udp-relay=false";
2542 var nserver = pobfs != "" ? "shadowsocks= " + [ipport, pmtd, pwd, pobfs, ptfo, pudp, tag].join(", ") : "shadowsocks= " + [ipport, pmtd, pwd, ptfo, pudp, tag].join(", ");
2543 return nserver
2544}
2545
2546
2547// surge 中的 Vmess 类型

Callers 1

Surge2QXFunction · 0.85

Calls 3

paraCheckFunction · 0.85
indexOfMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected