| 1762 | |
| 1763 | // Vmess obfs 参数 |
| 1764 | function Fobfs(jsonl, Pcert0, PTls13) { |
| 1765 | var obfsi = []; |
| 1766 | var cert = Pcert0; |
| 1767 | tcert = cert == 0 ? "tls-verification=false" : "tls-verification=true"; |
| 1768 | tls13 = PTls13 == 1 ? "tls13=true" : "tls13=false" |
| 1769 | if (jsonl.net == "ws" && jsonl.tls == "tls") { |
| 1770 | obfs0 = "obfs=wss, " + tcert + ", " + tls13 + ", "; |
| 1771 | uri0 = jsonl.path && jsonl.path != "" ? "obfs-uri=" + jsonl.path : "obfs-uri=/"; |
| 1772 | uri0 = uri0.indexOf("uri=/")!=-1 ? uri0:uri0.replace("uri=","uri=/") |
| 1773 | host0 = jsonl.host && jsonl.host != "" ? "obfs-host=" + jsonl.host + ", " : ""; |
| 1774 | obfsi.push(obfs0 + host0 + uri0) |
| 1775 | return obfsi.join(", ") |
| 1776 | } else if (jsonl.net == "ws") { |
| 1777 | obfs0 = "obfs=ws"; |
| 1778 | uri0 = jsonl.path && jsonl.path != "" ? "obfs-uri=" + jsonl.path : "obfs-uri=/"; |
| 1779 | uri0 = uri0.indexOf("uri=/")!=-1 ? uri0:uri0.replace("uri=","uri=/") |
| 1780 | host0 = jsonl.host && jsonl.host != "" ? "obfs-host=" + jsonl.host + ", " : ""; |
| 1781 | obfsi.push(obfs0, host0 + uri0); |
| 1782 | return obfsi.join(", ") |
| 1783 | } else if (jsonl.tls == "tls" && jsonl.net == "tcp") { // 过滤掉 h2/http 等类型 |
| 1784 | obfs0 = "obfs=over-tls, " + tcert + ", " + tls13; |
| 1785 | uri0 = jsonl.path && jsonl.path != "" ? "obfs-uri=" + jsonl.path : ""; |
| 1786 | uri0 = uri0.indexOf("uri=/")!=-1 ? uri0:uri0.replace("uri=","uri=/") |
| 1787 | host0 = jsonl.host && jsonl.host != "" ? ", obfs-host=" + jsonl.host : ""; |
| 1788 | obfsi.push(obfs0 + host0) |
| 1789 | return obfsi.join(", ") |
| 1790 | } else if (jsonl.net == "tcp" && jsonl.type == "http"){ |
| 1791 | obfs0 = "obfs=http"; |
| 1792 | uri0 = jsonl.path && jsonl.path != "" ? "obfs-uri=" + jsonl.path : "obfs-uri=/"; |
| 1793 | uri0 = uri0.indexOf("uri=/")!=-1 ? uri0:uri0.replace("uri=","uri=/") |
| 1794 | host0 = jsonl.host && jsonl.host != "" ? "obfs-host=" + jsonl.host + ", " : ""; |
| 1795 | obfsi.push(obfs0, host0 + uri0); |
| 1796 | return obfsi.join(", ") |
| 1797 | } else if (jsonl.net !="tcp"){ // 过滤掉 h2/http 等类型 |
| 1798 | Perror = 1 |
| 1799 | $notify("⚠️ Quantumult X 不支持该类型节点", "vmess + " + jsonl.net, JSON.stringify(jsonl)) |
| 1800 | return "NOT-SUPPORTTED" |
| 1801 | } else if (jsonl.net =="tcp" && jsonl.type != "none" && jsonl.type != "" && jsonl.type != "vmess") { |
| 1802 | return "NOT-SUPPORTTED" |
| 1803 | } else {return ""} |
| 1804 | } |
| 1805 | |
| 1806 | //对.的特殊处理(in/out & rename中) |
| 1807 | function Dot2(cnt) { |