| 2838 | |
| 2839 | //Clash vmess type server |
| 2840 | function CV2QX(cnt) { |
| 2841 | tag = "tag="+cnt.name.replace(/\\U.+?\s{1}/gi," ") |
| 2842 | ipt = cnt.server+":"+cnt.port |
| 2843 | pwd = "password=" + cnt.uuid |
| 2844 | mtd = "method="+ "aes-128-gcm" //cnt.cipher |
| 2845 | udp = cnt.udp ? "udp-relay=false" : "udp-relay=false" //暂不支持 |
| 2846 | tfo = cnt.tfo ? "fast-open=true" : "fast-open=false" |
| 2847 | obfs = "" |
| 2848 | if (cnt.network == "ws" && cnt.tls) { |
| 2849 | obfs = "obfs=wss" |
| 2850 | } else if (cnt.network == "ws"){ |
| 2851 | obfs = "obfs=ws" |
| 2852 | } else if (cnt.network == "http"){ |
| 2853 | obfs = "obfs=http" |
| 2854 | } else if (cnt.tls){ |
| 2855 | obfs = "obfs=over-tls" |
| 2856 | } |
| 2857 | console.log(obfs) |
| 2858 | const phost = getValue(()=>cnt["ws-opts"]["headers"]["Host"]) |
| 2859 | ohost = cnt["ws-headers"]? "obfs-host=" + cnt["ws-headers"]["Host"] : "" |
| 2860 | ohost = phost ? "obfs-host="+phost : ohost |
| 2861 | //ohost= cnt["ws-opts"]? "obfs-host=" + cnt["ws-opts"]["headers"]["Host"] : ohost |
| 2862 | ohost = cnt["servername"]? "obfs-host=" + cnt["servername"] : ohost |
| 2863 | console.log(ohost) |
| 2864 | ouri = cnt["ws-path"]? "obfs-uri="+cnt["ws-path"] : "" |
| 2865 | ouri = cnt["ws-opts"]? "obfs-uri="+cnt["ws-opts"]["path"] : ouri |
| 2866 | cert = cnt["skip-cert-verify"] && cnt.tls ? "tls-verification=false" : "" |
| 2867 | caead = cnt["alterId"] && cnt["alterId"]!=0? "aead=false" : "" // aead 选项 |
| 2868 | //caead = cnt["alterId"] == 0? "aead=true" : caead // aead 选项 |
| 2869 | console.log(caead) |
| 2870 | //caead="" |
| 2871 | //$notify(cert) |
| 2872 | if (Pcert0 == 1 && cnt.tls) { |
| 2873 | cert = "tls-verification=true" |
| 2874 | } else if (Pcert0 != 1 && cnt.tls) { |
| 2875 | cert = "tls-verification=false" |
| 2876 | } |
| 2877 | node = "vmess="+[ipt, pwd, mtd, udp, tfo, obfs, ohost, ouri, cert, caead, tag].filter(Boolean).join(", ") |
| 2878 | //console.log(node) |
| 2879 | return node |
| 2880 | } |
| 2881 | |
| 2882 | |
| 2883 | //Clash Trojan |