Skip to content

Commit be0de65

Browse files
committed
fix: 更新Clash订阅配置文件热补丁,优化fallback和nameserver-policy条目的生成逻辑
1 parent f299a65 commit be0de65

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

_worker.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,9 +799,8 @@ function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null,
799799
nameserver:
800800
- https://sm2.doh.pub/dns-query
801801
- https://dns.alidns.com/dns-query
802-
fallback:
802+
fallback:${ECH_DNS ? `\n - ${ECH_DNS}` : ''}
803803
- 8.8.4.4
804-
- 101.101.101.101
805804
- 208.67.220.220
806805
fallback-filter:
807806
geoip: true
@@ -826,7 +825,7 @@ function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null,
826825
// 如果 ECH 启用且 HOSTS 有效,添加 nameserver-policy
827826
if (ECH启用 && HOSTS.length > 0) {
828827
// 生成 HOSTS 的 nameserver-policy 条目
829-
const hostsEntries = HOSTS.map(host => ` "${host}":\n - https://doh.cm.edu.kg/CMLiussss${ECH_DNS ? `\n - ${ECH_DNS}` : ''}\n - tls://223.5.5.5\n - tls://8.8.8.8`).join('\n');
828+
const hostsEntries = HOSTS.map(host => ` "${host}":${ECH_DNS ? `\n - ${ECH_DNS}` : ''}\n - https://doh.cm.edu.kg/CMLiussss`).join('\n');
830829

831830
// 检查是否存在 nameserver-policy:
832831
const hasNameserverPolicy = /^\s{2}nameserver-policy:\s*(?:\n|$)/m.test(clash_yaml);

0 commit comments

Comments
 (0)