From f91d7a8afe8c94bff4cec945663b9df6ba0cddc4 Mon Sep 17 00:00:00 2001 From: Shawn <45581750+KOP-XIAO@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:52:08 +0800 Subject: [PATCH] Update resource-parser.js --- Scripts/resource-parser.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Scripts/resource-parser.js b/Scripts/resource-parser.js index a84e4a3..458773b 100644 --- a/Scripts/resource-parser.js +++ b/Scripts/resource-parser.js @@ -1,5 +1,5 @@ /** -☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-05 11:40⟧ +☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-06 11:00⟧ ---------------------------------------------------------- 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API @@ -39,7 +39,7 @@ ⦿ ptn/npt=1-8, 将节点名英文/数字替换成样式 ⇒ 🅰/🄰/𝐀/𝗮/𝔸/𝕒/ᵃ/ᴬ, ①\❶\⓵\𝟙\¹\₁\𝟏\𝟷 ⦿ delreg, 利用正则表达式来删除 "节点名" 中的字段(⚠️ 慎用) ⦿ aead=-1, 关闭 Vmess 的 AEAD 参数 -⦿ host=xxx , 修改 host 参数(如有) +⦿ host=xxx, 修改已有 host , 如要增加host,请用☠️结尾 ⦿ checkurl=xxx , 指定 server_check_url 参数 ⦿ sort=1/-1/x/参数规则, 按节点名 正/逆/随机/参数规则 排序 ❖ 参数规则是正则表达式或简单关键词, 用"<" 或 ">" 连接 @@ -874,7 +874,15 @@ function CDN(cnt) { // 指定节点 host 参数 function HOST_Handle(cnt,phost) { phost="host="+phost+"," - cnt = cnt.replace(/host\s*\=(.*?)\,/,phost) + if (phost.indexOf("☠️") == -1) { //只替换已有host类型 + cnt = cnt.replace(/host\s*\=(.*?)\,/,phost) + } else { // 增加 obfs-host\tls-host + if (/over-tls\s*\=\s*true/.test(cnt)) { + cnt = cnt+", tls-"+phost + } else if (/obfs\s*\=/.test(cnt)) { + cnt = cnt + ", obfs-"+phost + } + } return cnt }