分享一下自己clash verge 使用的全局扩展脚本
- 内容介绍
- 文章标签
- 相关推荐
优点:
1、会自动切换最优节点,自己的mac mini 上测试开启代理好几天都没有断开链接
2、在原版的基础上简化了一些东西代理组,使用起来更加简单
如果有自己自定义添加的规则,放到ruleProviders的custom 里
自己修改后的:
/***
* Clash Verge Rev / Mihomo Party 优化脚本
* 原作者: dahaha-365 (YaNet)
* Github:https://github.com/dahaha-365/YaNet
*/
function stringToArray(val) {
if (Array.isArray(val)) return val;
if (typeof val !== "string") return [];
return val
.split(";")
.map((item) => item.trim())
.filter((item) => item.length > 0);
}
// --- 1. 静态配置区域 ---
const _skipIps =
"10.0.0.0/8;100.64.0.0/10;127.0.0.0/8;169.254.0.0/16;172.16.0.0/12;192.168.0.0/16;198.18.0.0/16;FC00::/7;FE80::/10;::1/128";
// DNS 配置
const _chinaDohDns =
"https://doh.pub/dns-query;https://dns.alidns.com/dns-query";
const _foreignDohDns =
"https://dns.google/dns-query;https://dns.adguard-dns.com/dns-query";
const _chinaIpDns = "119.29.29.29;223.5.5.5";
const _foreignIpDns = "8.8.8.8;94.140.14.14";
/**
优点:
1、会自动切换最优节点,自己的mac mini 上测试开启代理好几天都没有断开链接
2、在原版的基础上简化了一些东西代理组,使用起来更加简单
如果有自己自定义添加的规则,放到ruleProviders的custom 里
自己修改后的:
/***
* Clash Verge Rev / Mihomo Party 优化脚本
* 原作者: dahaha-365 (YaNet)
* Github:https://github.com/dahaha-365/YaNet
*/
function stringToArray(val) {
if (Array.isArray(val)) return val;
if (typeof val !== "string") return [];
return val
.split(";")
.map((item) => item.trim())
.filter((item) => item.length > 0);
}
// --- 1. 静态配置区域 ---
const _skipIps =
"10.0.0.0/8;100.64.0.0/10;127.0.0.0/8;169.254.0.0/16;172.16.0.0/12;192.168.0.0/16;198.18.0.0/16;FC00::/7;FE80::/10;::1/128";
// DNS 配置
const _chinaDohDns =
"https://doh.pub/dns-query;https://dns.alidns.com/dns-query";
const _foreignDohDns =
"https://dns.google/dns-query;https://dns.adguard-dns.com/dns-query";
const _chinaIpDns = "119.29.29.29;223.5.5.5";
const _foreignIpDns = "8.8.8.8;94.140.14.14";
/**

