clash-verge usage method
node configuration
The file format is yaml and except from DNS configuration, there remains 2 big parts, proxy and routing rules.
proxy
proxy
This part function is that add nodes information, as follows. (the number of nodes is random as long as you have )
proxy-groups
This part function is that package and group the defined nodes. ('url-test' means that select node with the lowest delay)
routing rules
The normal routing rule setting is like
strategy,domain name or IP, rule
some strategies introduce:
- DOMAIN: 匹配完整域名
- DOMAIN-SUFFIX: 匹配域名后缀(例:
google.com匹配www.google.com/mail.google.com和google.com,但不匹配content-google.com)- DOMAIN-KEYWORD: 使用域名关键字匹配
you also can use other writted rule-set to configure routing rule
RULE-SET, name of costum rule-set, rule
The funtion of 全局扩展脚本
Every subscription has its own configuration. If you define rules in the global extension script, these rules will be used in all subscriptions. For example:
function main(config) {
// 定义你的自定义规则
const customRules = [
"DOMAIN-SUFFIX,libvio.fun,DIRECT"
];
// 规则可以有多条,例如:const customRules1,const customRules2,......
// 确保 config["rules"] 存在,如果不存在则初始化为空数组
if (!config["rules"]) {
config["rules"] = [];
}
// 将自定义规则追加到现有规则中(放在规则列表的前面)
config["rules"].unshift(...customRules);
// 或者放在规则列表的后面:config["rules"].push(...customRules);
// 返回修改后的配置
return config;
}



