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

Function CT2QX

Script/Parser.js:2884–2909  ·  view source on GitHub ↗
(cnt)

Source from the content-addressed store, hash-verified

2882
2883//Clash Trojan
2884function CT2QX(cnt) {
2885 tag = "tag="+cnt.name.replace(/\\U.+?\s{1}/gi," ")
2886 ipt = cnt.server+":"+cnt.port
2887 pwd = "password=" + cnt.password
2888 otls = "over-tls=true"
2889 opath=""
2890 ohost=""
2891 cert = cnt["skip-cert-verify"] ? "tls-verification=false" : "tls-verification=true"
2892 cert = Pcert0 == 1 ? "tls-verification=true" : "tls-verification=false"
2893 tls13 = PTls13 == 1 ? "tls13=true" : "tls13=false"
2894 udp = cnt.udp ? "udp-relay=false" : "udp-relay=false"
2895 tfo = cnt.tfo ? "fast-open=true" : "fast-open=false"
2896 if (cnt.network=="ws") { //wss类型
2897 otls = "obfs=wss"
2898 //$notify("trojan","WS",JSON.stringify(cnt))
2899 if (cnt["ws-opts"]){
2900 opath = cnt["ws-opts"]["path"]? "obfs-uri="+cnt["ws-opts"]["path"] : ""
2901 ohost = cnt["ws-opts"]["headers"]? "obfs-host="+cnt["ws-opts"]["headers"]["Host"] : ""
2902 }
2903 //$notify("trojan","WS",opath+":"+ohost)
2904 }
2905 node = "trojan="+[ipt, pwd, otls, opath, ohost, cert, tls13, udp, tfo, tag].filter(Boolean).join(", ")
2906 //console.log(node)
2907 return node
2908
2909}
2910
2911// Clash http
2912function CH2QX(cnt){

Callers 1

Clash2QXFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected