Parsers run at the moment a subscription finishes downloading or updating and transform its content automatically. Unlike the globally applied Mixin, a Parser can target exactly one subscription - ideal for users juggling several providers.
Where to edit
Settings → Parsers → Edit opens a YAML file structured like this:
parsers:
# match one subscription by exact url
- url: https://example.com/api/sub?token=abc
yaml:
prepend-rules:
- DOMAIN-SUFFIX,company.com,DIRECT
- DOMAIN-KEYWORD,tracker,REJECT
append-proxies:
- name: "my-backup"
type: ss
server: my.server.com
port: 8388
cipher: aes-256-gcm
password: mypass
Shortcuts available in the yaml section
| Directive | Effect |
|---|---|
prepend-rules / append-rules | Insert rules at the top / bottom (top = higher priority). |
prepend-proxies / append-proxies | Insert nodes. |
prepend-proxy-groups / append-proxy-groups | Insert proxy groups. |
mix-proxy-providers / mix-rule-providers | Merge provider definitions. |
mix-object | Shallow-merge any top-level fields (dns, tun, …). |
code mode: full programmatic control
parsers:
- reg: ^https://example\.com/
code: |
module.exports.parse = (raw, { yaml }) => {
const config = yaml.parse(raw);
// drop "informational" nodes like expiry notices
config.proxies = config.proxies.filter(
p => !/expire|remaining|website/i.test(p.name)
);
return yaml.stringify(config);
};
reg matches subscription URLs by regex - one parser can cover several subscriptions from the same provider.