| 2611 | } |
| 2612 | // surge 中的 http 类型 |
| 2613 | function Shttp2QX(content) { |
| 2614 | var cnt = content; |
| 2615 | var tag = "tag=" + cnt.split("=")[0].trim(); |
| 2616 | var ipport = cnt.split(",")[1].trim() + ":" + cnt.split(",")[2].trim(); |
| 2617 | var puname = cnt.indexOf("username") != -1 ? "username=" + cnt.split("username")[1].split(",")[0].split("=")[1].trim() : ""; |
| 2618 | var pwd = cnt.indexOf("password") != -1 ? "password=" + cnt.split("password")[1].split(",")[0].split("=")[1].trim() : ""; |
| 2619 | var ptls = cnt.split("=")[1].split(",")[0].trim() == "https" ? "over-tls=true" : "over-tls=false"; |
| 2620 | var ptfo = paraCheck(cnt, "tfo") == "true" ? "fast-open=true" : "fast-open=false"; |
| 2621 | if (ptls == "over-tls=true") { |
| 2622 | var pverify = cnt.replace(/ /g,"").indexOf("skip-cert-verify=false") != -1 ? "tls-verification=true" : "tls-verification=false"; |
| 2623 | pvefify = Pcert0 == 1? "tls-verification=true" : pverify ; |
| 2624 | var ptls13 = paraCheck(cnt, "tls13") == "true" ? "tls13=true" : "tls13=false"; |
| 2625 | ptls = ptls + ", " + pverify + ", " + ptls13 |
| 2626 | } |
| 2627 | var nserver = puname != "" ? "http= " + [ipport, puname, pwd, ptls, ptfo, tag].join(", ") : "http= " + [ipport, ptls, ptfo, tag].join(", "); |
| 2628 | return nserver |
| 2629 | } |
| 2630 | |
| 2631 | // surge 中的 socks5 类型 |
| 2632 | function SS52QX(content) { |