Custom Routes
Quick Example
Match Conditions
| Condition |
Description |
Example |
domains |
Exact domain match |
["api.example.com"] |
domain_suffixes |
Suffix match |
["example.com"] |
ip_cidrs |
IP CIDR ranges |
["10.0.0.0/8"] |
ports |
Port (single or range) |
["443", "8000-9000"] |
networks |
Protocol |
["tcp"] or ["udp"] |
source_cidrs |
Source IP CIDR |
["192.168.1.0/24"] |
source_ports |
Source port |
["1024-65535"] |
Action Types
| Action |
Description |
{"type": "direct"} |
Direct connection, bypass proxy |
{"type": "block"} |
Block connection |
{"type": "route", "target": "tag"} |
Route to specified outbound (by tag) |
Application Order
- Structured
custom_route_rules (highest priority)
- Raw
custom_routes
- Built-in blocklist rules
- Panel routes
Kernel Compatibility
| Feature |
Xray |
Sing-box |
| All match conditions |
✅ |
✅ |
| direct / block / route |
✅ |
✅ |
Best Practices
- Prefer
custom_route_rules: cross-kernel compatible, panel-managed
- Use
custom_routes only: when native features are needed (e.g., load balancing)