Rule Providers
A rule provider is a named list of domains, IP ranges or rules, kept outside the main rules: list and referenced with RULE-SET,<name>,<target>.
rule-providers: streaming: type: http behavior: domain format: mrs url: https://example.com/rules/streaming.mrs interval: 86400
private-ip: type: http behavior: ipcidr format: text url: https://example.com/rules/private.txt
my-rules: type: inline behavior: classical payload: - DOMAIN-SUFFIX,example.com - IP-CIDR,192.0.2.0/24,no-resolve
rules: - RULE-SET,streaming,Streaming - RULE-SET,private-ip,DIRECT,no-resolve - RULE-SET,my-rules,Proxy - MATCH,ProxyOptions
Section titled “Options”| Key | Type | Default | Description |
|---|---|---|---|
type |
string | required | http or inline. See Types. |
behavior |
string | required | domain, ipcidr or classical. |
format |
string | yaml |
yaml, text or mrs. |
url |
string | — | Download URL (http type). |
interval |
int (seconds) | 86400 |
How long a downloaded copy counts as fresh. Minimum 60. |
payload |
list | — | The entries (inline type). |
path |
string | — | Ignored. MeowX manages the cache location itself. |
proxy, size-limit and other mihomo provider options are ignored.
type |
Status |
|---|---|
http |
Supported. Downloaded and cached by MeowX; see Downloading and caching. |
inline |
Supported. Entries come from payload. |
file |
Not supported. MeowX can’t read files from your file system path; a file provider never loads, and rules referencing it never match. Use inline or host the file and use http. |
Behaviors
Section titled “Behaviors”domain
Section titled “domain”Each entry is a domain pattern:
| Pattern | Matches |
|---|---|
example.com |
Exactly example.com. |
*.example.com |
Exactly one level of subdomain: a.example.com, not b.a.example.com and not example.com. |
+.example.com |
example.com and all subdomains (like DOMAIN-SUFFIX). |
.example.com |
All subdomains, but not example.com itself. |
ipcidr
Section titled “ipcidr”Each entry is an IPv4 or IPv6 range (192.0.2.0/24, 2001:db8::/32); a bare address means a single host. One invalid entry makes the whole provider fail to load.
Rules using an ipcidr provider need the destination IP, so no-resolve applies as for IP-CIDR; see Rules → no-resolve.
classical
Section titled “classical”Each entry is a rule without a target, for example DOMAIN-SUFFIX,example.com, IP-CIDR,192.0.2.0/24,no-resolve or DST-PORT,443. The supported rule types and their syntax are the same as in Rules. Notes:
- An entry with an unknown rule type makes the whole provider fail to load (the rest of the configuration is unaffected).
RULE-SETinside a classical provider never matches.GEOSITEinside a classical provider only matches if the same category is also used by a top-level rule or bydns.nameserver-policy, because only those categories are loaded from the GeoSite database.- IP entries without
no-resolvemake MeowX resolve the domain of fake-ip connections, exactly like top-level IP rules.
Formats
Section titled “Formats”format |
Content |
|---|---|
yaml |
A YAML document with a payload: list. An empty payload: is valid (zero entries). |
text |
One entry per line. Empty lines are skipped; text after # or // is a comment. |
mrs |
mihomo’s compressed binary rule-set format. Supported for domain and ipcidr behaviors only (mihomo can’t produce classical MRS either). The behavior in the file must match behavior. |
Downloading and caching
Section titled “Downloading and caching”http providers are downloaded by MeowX and cached on the device. When the tunnel starts, it loads the cached copies.
- When you activate or refresh a subscription, providers are downloaded in the background.
- When you connect, MeowX waits only for providers that have no cached copy yet (for example the first time you use a subscription), for at most 8 seconds. Providers that already have a cached copy — even an expired one — don’t delay the connection.
- After connecting, providers whose copy is older than
intervalare refreshed in the background. The refreshed copies are used from the next connection. - A copy is considered fresh only if it is younger than
intervaland still parses. A damaged cached file is downloaded again. - A download is accepted only if the server answers with a 2xx status, the body isn’t empty, and the content parses as the declared behavior and format. Anything else — including an HTML login or error page from a captive portal — is discarded and the previous cached copy is kept.
- Requests use the
User-Agentclash.meta/1.0 (MeowX)and time out after 20 seconds.
If a provider can’t be loaded when the tunnel starts (never downloaded, or unparseable), the app’s log shows a warning naming it, and rules referencing it don’t match until it loads; the rest of the configuration works normally.
