obfs-uri issue

This commit is contained in:
Shawn
2020-11-20 09:51:20 +08:00
parent 84024f0ffa
commit 9d63f20187

View File

@@ -1,5 +1,5 @@
/**
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2020-11-12 16:29⟧
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2020-11-20 10:29⟧
----------------------------------------------------------
🛠 发现 𝐁𝐔𝐆 请反馈: @Shawn_KOP_bot
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
@@ -908,18 +908,21 @@ function Pobfs(jsonl, Pcert, Ptls13) {
if (jsonl.net == "ws" && jsonl.tls == "tls") {
obfs0 = "obfs=wss, " + tcert + ", " + tls13 + ", ";
uri0 = jsonl.path && jsonl.path != "" ? "obfs-uri=" + jsonl.path : "obfs-uri=/";
uri0 = uri0.indexOf("uri=/")!=-1 ? uri0:uri0.replace("uri=","uri=/")
host0 = jsonl.host && jsonl.host != "" ? "obfs-host=" + jsonl.host + ", " : "";
obfsi.push(obfs0 + host0 + uri0)
return obfsi.join(", ")
} else if (jsonl.net == "ws") {
obfs0 = "obfs=ws";
uri0 = jsonl.path && jsonl.path != "" ? "obfs-uri=" + jsonl.path : "obfs-uri=/";
uri0 = uri0.indexOf("uri=/")!=-1 ? uri0:uri0.replace("uri=","uri=/")
host0 = jsonl.host && jsonl.host != "" ? "obfs-host=" + jsonl.host + ", " : "";
obfsi.push(obfs0, host0 + uri0);
return obfsi.join(", ")
} else if (jsonl.tls == "tls" && jsonl.net == "tcp") { // 过滤掉 h2/http 等类型
obfs0 = "obfs=over-tls, " + tcert + ", " + tls13;
uri0 = jsonl.path && jsonl.path != "" ? "obfs-uri=" + jsonl.path : "";
uri0 = uri0.indexOf("uri=/")!=-1 ? uri0:uri0.replace("uri=","uri=/")
host0 = jsonl.host && jsonl.host != "" ? ", obfs-host=" + jsonl.host : "";
obfsi.push(obfs0 + host0)
return obfsi.join(", ")