Skip to content

Commit f6a208a

Browse files
authored
Merge pull request cmliu#916 from cmliu/beta2.0
fix: 更新Clash订阅配置文件热补丁,优化ECH启用逻辑并调整fallback DNS服务器
2 parents c8a01bc + 8542639 commit f6a208a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

_worker.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,8 @@ async function httpConnect(targetHost, targetPort, initialData) {
786786
}
787787
//////////////////////////////////////////////////功能性函数///////////////////////////////////////////////
788788
function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null, ECH启用 = false) {
789+
if (!ECH启用) return Clash_原始订阅内容;
790+
789791
const clash_yaml = `dns:
790792
enable: true
791793
default-nameserver:
@@ -797,10 +799,12 @@ function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null,
797799
- https://sm2.doh.pub/dns-query
798800
- https://dns.alidns.com/dns-query
799801
fallback:
800-
- 'https://dns.google/dns-query'
801-
- 'https://1.1.1.1/dns-query'
802+
- 8.8.4.4
803+
- 101.101.101.101
804+
- 208.67.220.220
802805
fallback-filter:
803806
geoip: true
807+
domain: [+.google.com, +.facebook.com, +.youtube.com]
804808
ipcidr:
805809
- 240.0.0.0/4
806810
- 0.0.0.0/32
@@ -810,7 +814,7 @@ function Clash订阅配置文件热补丁(Clash_原始订阅内容, uuid = null,
810814
- https://doh.cmliussss.net/CMLiussss
811815
` + Clash_原始订阅内容;
812816

813-
if (!uuid || !ECH启用) return clash_yaml;
817+
if (!uuid) return clash_yaml;
814818
const lines = clash_yaml.split('\n');
815819
const processedLines = [];
816820
let i = 0;

0 commit comments

Comments
 (0)