规则集
你可以使用来自 URL 或已配置的规则提供者(Rule Provider)的规则集合。Chute 还提供两个内置规则集。
内置规则集
SYSTEM
RULE-SET,SYSTEM,DIRECT
包含 macOS 和 iOS 自身发出的大多数请求的规则。App Store、iTunes 和其他内容服务发送的请求不包含在内。
USER-AGENT,*com.apple.mobileme.fmip1
USER-AGENT,*WeatherFoundation*
USER-AGENT,%E5%9C%B0%E5%9B%BE*
USER-AGENT,%E8%AE%BE%E7%BD%AE*
USER-AGENT,com.apple.geod*
USER-AGENT,com.apple.Maps
USER-AGENT,FindMyFriends*
USER-AGENT,FindMyiPhone*
USER-AGENT,FMDClient*
USER-AGENT,FMFD*
USER-AGENT,fmflocatord*
USER-AGENT,geod*
USER-AGENT,locationd*
USER-AGENT,Maps*
DOMAIN,api.smoot.apple.com
DOMAIN,captive.apple.com
DOMAIN,configuration.apple.com
DOMAIN,guzzoni.apple.com
DOMAIN,smp-device-content.apple.com
DOMAIN,xp.apple.com
DOMAIN-SUFFIX,ess.apple.com
DOMAIN-SUFFIX,push-apple.com.akadns.net
DOMAIN-SUFFIX,push.apple.com
DOMAIN,aod.itunes.apple.com
DOMAIN,mesu.apple.com
DOMAIN,api.smoot.apple.cn
DOMAIN,gs-loc.apple.com
DOMAIN,mvod.itunes.apple.com
DOMAIN,streamingaudio.itunes.apple.com
DOMAIN-SUFFIX,lcdn-locator.apple.com
DOMAIN-SUFFIX,lcdn-registration.apple.com
DOMAIN-SUFFIX,ls.apple.com
PROCESS-NAME,trustd
这些规则可能随 Chute 更新而更新。请参考软件中的描述以获取最新的子规则。
LAN
RULE-SET,LAN,DIRECT
包含 LAN IP 地址和 .local 后缀的规则。请注意,此规则集会触发 DNS 查询。
DOMAIN-SUFFIX,local
IP-CIDR,192.168.0.0/16
IP-CIDR,10.0.0.0/8
IP-CIDR,172.16.0.0/12
IP-CIDR,127.0.0.0/8
IP-CIDR,100.64.0.0/10
IP-CIDR,255.0.0.0/8
IP-CIDR,fc00::/7
IP-CIDR,::1/128
IP-CIDR,fe80::/10
外部规则集
来自 http(s) URL 的规则集。规则集文件应为纯文本文件,每行包含一条不含策略的规则声明。
RULE-SET,https://example.com/my-rules.txt,Proxy
RULE-SET,https://example.com/my-rules.txt,Proxy,update-interval=86400
可选的 update-interval 参数会每隔 N 秒重新下载规则集(默认:不自动刷新)。
规则集文件示例:
DOMAIN,exampleA.com
DOMAIN,exampleB.com
如需使用本地文件,请在 [Rule Provider] 段中通过 path= 参数定义一个条目,然后按名称引用它:
[Rule Provider]
my-rules = type=file, path=my-rules.txt, format=native
[Rule]
RULE-SET,my-rules,Proxy
规则提供者参数:type(http、file 或 inline;http 需要 url=)、behavior(classical 表示规则声明,domain 表示域名集;默认 classical)、format(native 表示 Chute 规则行,mihomo-yaml 表示 Clash/mihomo rule-provider YAML 载荷;默认 mihomo-yaml)以及 interval(刷新秒数,默认 86400)。
RULE-SET 和 DOMAIN-SET 不能作为 AND/OR/NOT 逻辑规则的子规则使用。
域名集
域名集类似于外部规则集,但专门用于域名,并使用更紧凑的文件格式。
DOMAIN-SET,https://example.com/domains.txt,DIRECT
DOMAIN-SET,https://example.com/domains.txt,DIRECT,update-interval=86400
类型之后的第一个字段必须是 http(s) URL。域名集文件包含裸域名,每行一个(而不是规则声明):
# exact domain
example.com
# the domain and all of its subdomains
.example.org
+.example.net
以 # 或 // 开头的行为注释。