MCPcopy
hub / github.com/KOP-XIAO/QuantumultX / SCT2QX

Function SCT2QX

Scripts/resource-parser.js:3410–3427  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

3408// surge2 中的 SS 类型写法(custom)
3409//🇷🇺 俄罗斯 GIA = custom, ip, 152, aes-128-gcm, password123, https://xxx/download/SSEncrypt.module, obfs=tls, obfs-host=xxx.windows.com, udp-relay=true
3410function SCT2QX(content) {
3411 var cnt = content;
3412 var tag = "tag=" + cnt.split("=")[0].trim();
3413 var ipport = cnt.split(",")[1].trim() + ":" + cnt.split(",")[2].trim();
3414 var pmtd = "method=" + cnt.split(",")[3].trim();
3415 var pwd = "password=" + cnt.split(",")[4].trim();
3416 if (cnt.indexOf("obfs") != -1) {
3417 pobfs = "obfs=" + cnt.replace(/obfs-host/, "").split("obfs")[1].split(",")[0].split("=")[1]
3418 } else { pobfs = "" }
3419 var phost = cnt.indexOf("obfs-host") != -1 ? "obfs-host" + cnt.split("obfs-host")[1].split(",")[0].trim() : "";
3420 if (phost != "") {
3421 pobfs = pobfs + ", " + phost
3422 }
3423 var ptfo = paraCheck(cnt, "tfo") == "true" ? "fast-open=true" : "fast-open=false";
3424 var pudp = paraCheck(cnt, "udp-relay") == "true" ? "udp-relay=true" : "udp-relay=false";
3425 var nserver = pobfs != "" ? "shadowsocks= " + [ipport, pmtd, pwd, pobfs, ptfo, pudp, tag].join(", ") : "shadowsocks= " + [ipport, pmtd, pwd, ptfo, pudp, tag].join(", ");
3426 return nserver
3427}
3428
3429
3430// surge3 中的 SS 类型

Callers 1

Surge2QXFunction · 0.85

Calls 1

paraCheckFunction · 0.85

Tested by

no test coverage detected