| 3539 | |
| 3540 | // surge 中的 http 类型 |
| 3541 | function Shttp2QX(content) { |
| 3542 | var cnt = content; |
| 3543 | var tag = "tag=" + cnt.split("=")[0].trim(); |
| 3544 | var ipport = cnt.split(",")[1].trim() + ":" + cnt.split(",")[2].trim(); |
| 3545 | var puname = cnt.indexOf("username") != -1 ? "username=" + cnt.split("username")[1].split(",")[0].split("=")[1].trim() : ""; |
| 3546 | var pwd = cnt.indexOf("password") != -1 ? "password=" + cnt.split("password")[1].split(",")[0].split("=")[1].trim() : ""; |
| 3547 | var ptls = cnt.split("=")[1].split(",")[0].trim() == "https" ? "over-tls=true" : "over-tls=false"; |
| 3548 | var ptfo = paraCheck(cnt, "tfo") == "true" ? "fast-open=true" : "fast-open=false"; |
| 3549 | if (ptls == "over-tls=true") { |
| 3550 | var pverify = cnt.replace(/ /g,"").indexOf("skip-cert-verify=false") != -1 ? "tls-verification=true" : "tls-verification=false"; |
| 3551 | pvefify = Pcert0 == 1? "tls-verification=true" : pverify ; |
| 3552 | var ptls13 = paraCheck(cnt, "tls13") == "true" ? "tls13=true" : "tls13=false"; |
| 3553 | ptls = ptls + ", " + pverify + ", " + ptls13 |
| 3554 | } |
| 3555 | var nserver = puname != "" ? "http= " + [ipport, puname, pwd, ptls, ptfo, tag].join(", ") : "http= " + [ipport, ptls, ptfo, tag].join(", "); |
| 3556 | return nserver |
| 3557 | } |
| 3558 | |
| 3559 | // surge 中的 socks5 类型 |
| 3560 | function SS52QX(content) { |