parsers: # array # - reg: .*$ 匹配所有订阅,或 - url: https://example.com/profile.yaml 指定订阅 - reg: .*$ # 删除服务商提供的策略组和规则 code: | module.exports.parse = (raw, { yaml }) => { const rawObj = yaml.parse(raw) const groups = [] const rules = [] return yaml.stringify({ ...rawObj, 'proxy-groups': groups, rules }) } # 建立自己的配置 yaml: prepend-proxy-groups: # 建立策略组 - name: 🔰 选择节点 type: select - name: 🛑 广告拦截 type: select proxies: - DIRECT - REJECT - 🔰 选择节点 - name: 🐟 漏网之鱼 type: select proxies: - DIRECT - 🔰 选择节点 # 其他示例 # - name: 分组名 # type: url-test # 自动选择延迟最低的节点,也可填 fallback 节点故障时切换下一个,laod-balance 负载均衡 # url: http://www.gstatic.com/generate_204 # interval: 300 # tolerance: 50 commands: - proxy-groups.🔰 选择节点.proxies=[]proxyNames # 向指定策略组添加订阅节点名,也可使用正则包含且不包含:[]proxyNames|^包含((?!排除).)*$ 过滤节点 - proxy-groups.🔰 选择节点.proxies.0+DIRECT # 向指定分组第一个位置添加 DIRECT 节点名 # 添加规则 prepend-rules: - RULE-SET,applications,DIRECT - DOMAIN,clash.razord.top,DIRECT - DOMAIN,yacd.haishan.me,DIRECT - RULE-SET,private,DIRECT - RULE-SET,reject,🛑 广告拦截 - RULE-SET,icloud,DIRECT - RULE-SET,apple,DIRECT - RULE-SET,google,DIRECT - RULE-SET,tld-not-cn,🔰 选择节点 - RULE-SET,gfw,🔰 选择节点 - RULE-SET,greatfire,🔰 选择节点 - RULE-SET,telegramcidr,🔰 选择节点 - RULE-SET,lancidr,DIRECT - RULE-SET,cncidr,DIRECT - GEOIP,,DIRECT - GEOIP,CN,DIRECT - RULE-SET,direct,DIRECT - RULE-SET,proxy,🔰 选择节点 - MATCH,🐟 漏网之鱼 # 添加规则集 mix-rule-providers: reject: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/reject.txt" path: ./ruleset/reject.yaml interval: 86400 icloud: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/icloud.txt" path: ./ruleset/icloud.yaml interval: 86400 apple: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/apple.txt" path: ./ruleset/apple.yaml interval: 86400 google: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/google.txt" path: ./ruleset/google.yaml interval: 86400 proxy: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/proxy.txt" path: ./ruleset/proxy.yaml interval: 86400 direct: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/direct.txt" path: ./ruleset/direct.yaml interval: 86400 private: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/private.txt" path: ./ruleset/private.yaml interval: 86400 gfw: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/gfw.txt" path: ./ruleset/gfw.yaml interval: 86400 greatfire: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/greatfire.txt" path: ./ruleset/greatfire.yaml interval: 86400 tld-not-cn: type: http behavior: domain url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/tld-not-cn.txt" path: ./ruleset/tld-not-cn.yaml interval: 86400 telegramcidr: type: http behavior: ipcidr url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/telegramcidr.txt" path: ./ruleset/telegramcidr.yaml interval: 86400 cncidr: type: http behavior: ipcidr url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/cncidr.txt" path: ./ruleset/cncidr.yaml interval: 86400 lancidr: type: http behavior: ipcidr url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/lancidr.txt" path: ./ruleset/lancidr.yaml interval: 86400 applications: type: http behavior: classical url: "https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/applications.txt" path: ./ruleset/applications.yaml interval: 86400