| 2805 | |
| 2806 | //Clash ssr type server |
| 2807 | function CSSR2QX(cnt) { |
| 2808 | tag = "tag="+cnt.name.replace(/\\U.+?\s{1}/gi,"") |
| 2809 | ipt = cnt.server+":"+cnt.port |
| 2810 | pwd = "password=" + cnt.password |
| 2811 | mtd = "method="+ cnt.cipher |
| 2812 | udp = cnt.udp ? "udp-relay=true" : "udp-relay=false" |
| 2813 | tfo = cnt.tfo ? "fast-open=true" : "fast-open=false" |
| 2814 | prot = "ssr-protocol=" + cnt.protocol |
| 2815 | ohost="" |
| 2816 | ppara="" |
| 2817 | if(cnt["protocolparam"]) { |
| 2818 | cnt["protocol-param"] = cnt["protocolparam"] |
| 2819 | } |
| 2820 | if (typeof(cnt["protocol-param"]) == "string") { |
| 2821 | ppara = "ssr-protocol-param=" + cnt["protocol-param"] |
| 2822 | } else if (typeof(cnt["protocol-param"]) == "object") { |
| 2823 | console.log(typeof(cnt["protocol-param"])) |
| 2824 | ppara = "ssr-protocol-param=" + JSON.stringify(cnt["protocol-param"]).replace(/{|}|\s|"/g,"") |
| 2825 | } |
| 2826 | obfs = "obfs=" + cnt.obfs |
| 2827 | if ( cnt["obfs-param"]) { |
| 2828 | ohost = "obfs-host=" + cnt["obfs-param"] |
| 2829 | } else if (cnt["obfsparam"]) { |
| 2830 | ohost = "obfs-host=" + cnt["obfsparam"] |
| 2831 | } |
| 2832 | |
| 2833 | node = "shadowsocks="+[ipt, pwd, mtd, udp, tfo, prot, ppara, obfs, ohost, tag].filter(Boolean).join(", ") |
| 2834 | //console.log(node) |
| 2835 | return node |
| 2836 | } |
| 2837 | |
| 2838 | |
| 2839 | //Clash vmess type server |