Are you an LLM? You can read better optimized documentation at /en\tutorial\override\YAML.md for this page in Markdown format
YAML
It overrides the original config with a deep merge, and has lower priority than the app's common config override.
If the target is a simple value, it is replaced directly.
For nested objects, the values are merged recursively; add ! to force the whole object to be replaced instead of merged.
For example:
yaml
# Replace the dns field outright with the following, without merging
dns!:
enable: falseFor arrays, you can use the + modifier to prepend or append.
For example:
yaml
# Replace the whole rules list
rules:
- DOMAIN,baidu.com,DIRECT
# Insert rules before the existing ones
+rules:
- DOMAIN,baidu.com,DIRECT
# Append rules after the existing ones
rules+:
- DOMAIN,baidu.com,DIRECTyaml
mixed-port: 7890
dns:
enable: true
ipv6: true
enhanced-mode: fake-ip
fake-ip-range: 28.0.0.1/8
nameserver: [https://dns.alidns.com/dns-query]
proxies:
- name: ss
type: ss
server: 127.0.0.1
port: 443
password: mihomo
cipher: none
proxy-groups:
- name: "China"
type: select
proxies:
- DIRECT
rules:
- GEOIP,CN,DIRECT
- MATCH,homeyaml
mixed-port: 7895
external-ui: ui
sniffer:
enable: true
override-destination: false
sniff:
HTTP:
ports: [80, 8080-8880]
override-destination: true
TLS:
ports: [443, 8443]
QUIC:
ports: [443, 8443]
tun:
enable: true
stack: mixed
auto-route: true
auto-detect-interface: true
strict-route: false
dns-hijack:
- any:53
dns:
enable: true
listen: :1053
ipv6: true
enhanced-mode: fake-ip
fake-ip-filter:
- "*"
- "+.lan"
- "+.local"
- live-push.bilivideo.com
default-nameserver:
- https://223.5.5.5/dns-query
nameserver:
- https://dns.alidns.com/dns-query
- https://doh.pub/dns-query
+proxies:
- name: Direct
type: direct
rule-providers:
cn_domain:
type: http
interval: 86400
behavior: domain
format: mrs
url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.mrs"
+rules:
- RULE-SER,cn_domain,CN
proxy-groups:
- name: CN
type: select
proxies:
- DIRECTyaml
mixed-port: 7895
external-ui: ui
sniffer:
enable: true
override-destination: false
sniff:
HTTP:
ports: [80, 8080-8880]
override-destination: true
TLS:
ports: [443, 8443]
QUIC:
ports: [443, 8443]
tun:
enable: true
stack: mixed
auto-route: true
auto-detect-interface: true
strict-route: false
dns-hijack:
- any:53
dns:
enable: true
listen: :1053
ipv6: true
enhanced-mode: fake-ip
fake-ip-range: 28.0.0.1/8
fake-ip-filter:
- "*"
- "+.lan"
- "+.local"
- live-push.bilivideo.com
default-nameserver:
- https://223.5.5.5/dns-query
nameserver:
- https://dns.alidns.com/dns-query
- https://doh.pub/dns-query
proxies:
- name: Direct
type: direct
- name: ss
type: ss
server: 127.0.0.1
port: 443
password: mihomo
cipher: none
proxy-groups:
- name: CN
type: select
proxies:
- DIRECT
rules:
- RULE-SET,cn_domain,CN
- GEOIP,CN,DIRECT
- MATCH,home
rule-providers:
cn_domain:
type: http
interval: 86400
behavior: domain
format: mrs
url: https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.mrs