| 2882 | |
| 2883 | //Clash Trojan |
| 2884 | function 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 |
| 2912 | function CH2QX(cnt){ |