Quick Config
Don't want to write a config from scratch? This template already has your subscription, region grouping, and routing rules for common streaming/social apps set up — just swap the subscription URL in proxy-providers for your own and you're ready to go.
What This Template Does
-
proxy-providersDynamically fetches nodes from a subscription link — the example reserves two subscription slots (provider1/provider2); just fill in your own subscription URLs, and make sure the names don't clash.
-
Automatic Region GroupingUses
include-all: true+ afilterregex to automatically sort every node into Hong Kong/Taiwan/Japan/Singapore/US/Other groups by keyword in the name — no need to maintain node lists by hand. -
Routing by App/RegionUses
GEOSITEandGEOIPrule sets to automatically route Google, Telegram, YouTube, Netflix, Bilibili, domestic traffic, and more into their matching proxy groups — anything unmatched defaults to the "Other" group.
Full Example (GEOSITE / GEOIP Version)
This version uses mihomo's built-in GEOSITE/GEOIP databases for routing decisions — the simplest config, with no extra rule provider files needed.
# Fill in your own subscription in url; names must be unique proxy-providers: provider1: url: "" type: http interval: 86400 health-check: { enable: true, url: "https://www.gstatic.com/generate_204", interval: 300 } proxies: - name: "Direct" type: direct udp: true mixed-port: 7890 ipv6: true allow-lan: true unified-delay: false tcp-concurrent: true external-controller: 127.0.0.1:9090 external-ui: ui external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip" find-process-mode: strict global-client-fingerprint: chrome profile: store-selected: true store-fake-ip: true sniffer: enable: true sniff: HTTP: ports: [80, 8080-8880] override-destination: true TLS: ports: [443, 8443] QUIC: ports: [443, 8443] tun: enable: true stack: mixed dns-hijack: - "any:53" auto-route: true auto-detect-interface: true dns: enable: true ipv6: true enhanced-mode: fake-ip fake-ip-filter: - "*" - "+.lan" - "+.local" default-nameserver: - tls://223.5.5.5 nameserver: - https://doh.pub/dns-query - https://dns.alidns.com/dns-query proxy-groups: - name: Default type: select proxies: [Auto, Direct, Hong Kong, Taiwan, Japan, Singapore, United States, Other Regions, All Nodes] - name: Google type: select proxies: [Default, Hong Kong, Taiwan, Japan, Singapore, United States, Other Regions, All Nodes, Auto, Direct] # Same pattern for Telegram / Twitter / Bilibili / Bahamut / YouTube / NETFLIX / Spotify / Github - name: Domestic type: select proxies: [Direct, Default, Hong Kong, Taiwan, Japan, Singapore, United States, Other Regions, All Nodes, Auto] - name: Other type: select proxies: [Default, Hong Kong, Taiwan, Japan, Singapore, United States, Other Regions, All Nodes, Auto, Direct] # Separator — region groups below, auto-sorted by the filter regex, no manual node maintenance needed - name: Hong Kong type: select include-all: true exclude-type: direct filter: "(?i)港|hk|hongkong|hong kong" # Taiwan/Japan/Singapore/US groups follow the same pattern, just with different filter keywords - name: Other Regions type: select include-all: true exclude-type: direct filter: "(?i)^(?!.*(?:港|hk|台|tw|日|jp|新|sg|美|us)).*" - name: All Nodes type: select include-all: true exclude-type: direct - name: Auto type: url-test include-all: true exclude-type: direct tolerance: 10 rules: - GEOIP,lan,Direct,no-resolve - GEOSITE,github,Github - GEOSITE,youtube,YouTube - GEOSITE,google,Google - GEOSITE,telegram,Telegram - GEOSITE,netflix,NETFLIX - GEOSITE,bilibili,Bilibili - GEOSITE,CN,Domestic - GEOSITE,geolocation-!cn,Other - GEOIP,CN,Domestic - MATCH,Other
Advanced: Switching to the RULE-SET Version
The version above uses the core's built-in GEOSITE/GEOIP databases — simple to configure, but updates only as often as the core itself. For more up-to-date rule data, you can swap GEOSITE/GEOIP for RULE-SET, referencing the MetaCubeX community-maintained rule sets (updated automatically every day):
rule-anchor: ip: &ip { type: http, interval: 86400, behavior: ipcidr, format: mrs } domain: &domain { type: http, interval: 86400, behavior: domain, format: mrs } rule-providers: cn_domain: <<: *domain url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/cn.mrs" github_domain: <<: *domain url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geosite/github.mrs" cn_ip: <<: *ip url: "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/meta/geo/geoip/cn.mrs" rules: - RULE-SET,private_ip,Direct,no-resolve - RULE-SET,github_domain,Github - RULE-SET,cn_domain,Domestic - RULE-SET,cn_ip,Domestic - MATCH,Other
The idea is the same as the GEOSITE version, just swapping the built-in database for online rule files (the &domain/&ip anchors reuse the common http/interval/behavior/format fields — see the anchor usage in the Syntax section). See the Rule Providers page for more details.