fix: 更新Clash订阅配置文件热补丁,优化ECH启用逻辑并调整fallback DNS服务器

This commit is contained in:
cmliu
2026-01-17 16:27:20 +08:00
parent 06dd74f195
commit 85426396fd

View File

@@ -786,6 +786,8 @@ async function httpConnect(targetHost, targetPort, initialData) {
} }
//////////////////////////////////////////////////功能性函数/////////////////////////////////////////////// //////////////////////////////////////////////////功能性函数///////////////////////////////////////////////
function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null, ECH启用 = false) { function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null, ECH启用 = false) {
if (!ECH启用) return Clash_原始订阅内容;
const clash_yaml = `dns: const clash_yaml = `dns:
enable: true enable: true
default-nameserver: default-nameserver:
@@ -797,10 +799,12 @@ function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null,
- https://sm2.doh.pub/dns-query - https://sm2.doh.pub/dns-query
- https://dns.alidns.com/dns-query - https://dns.alidns.com/dns-query
fallback: fallback:
- 'https://dns.google/dns-query' - 8.8.4.4
- 'https://1.1.1.1/dns-query' - 101.101.101.101
- 208.67.220.220
fallback-filter: fallback-filter:
geoip: true geoip: true
domain: [+.google.com, +.facebook.com, +.youtube.com]
ipcidr: ipcidr:
- 240.0.0.0/4 - 240.0.0.0/4
- 0.0.0.0/32 - 0.0.0.0/32
@@ -810,7 +814,7 @@ function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null,
- https://doh.cmliussss.net/CMLiussss - https://doh.cmliussss.net/CMLiussss
` + Clash_原始订阅内容; ` + Clash_原始订阅内容;
if (!uuid || !ECH启用) return clash_yaml; if (!uuid) return clash_yaml;
const lines = clash_yaml.split('\n'); const lines = clash_yaml.split('\n');
const processedLines = []; const processedLines = [];
let i = 0; let i = 0;