Routing
Decides where each request goes: to an outbound, or nowhere. Rules are checked in order; the first rule whose action decides wins, and default_action takes the rest. Without a routing section, every request takes the first outbound.
Structure
json
{
"routing": {
"rules": [
{
"match": { "domain_suffix": ["ir"] },
"action": {
"type": "route",
"settings": { "outbound": "direct" }
}
}
],
"default_action": {
"type": "route",
"settings": { "outbound": "proxy" }
}
}
}Example
A client in Iran: ads blocked, local and Iranian destinations direct, QUIC blocked so browsers fall back to TCP, everything else through the proxy.
json
{
"datasets": [
{
"tag": "ads",
"source": { "file": "geosite.dat" },
"format": {
"type": "geodata",
"kind": "domain",
"category": "category-ads-all"
}
},
{
"tag": "ir-domains",
"source": { "file": "geosite.dat" },
"format": {
"type": "geodata",
"kind": "domain",
"category": "category-ir"
}
},
{
"tag": "ir-ips",
"source": { "file": "geoip.dat" },
"format": { "type": "geodata", "kind": "ip", "category": "ir" }
}
],
"routing": {
"rules": [
{
"match": { "network": "tcp" },
"action": {
"type": "sniff",
"settings": {
"sniffers": [{ "type": "tls" }, { "type": "http" }]
}
}
},
{
"match": { "domain_in_dataset": ["ads"] },
"action": { "type": "block" }
},
{
"match": {
"any": [
{ "ip_is_private": true },
{ "domain_in_dataset": ["ir-domains"] },
{ "ip_in_dataset": ["ir-ips"] }
]
},
"action": {
"type": "route",
"settings": { "outbound": "direct" }
}
},
{
"match": { "network": "udp", "port": [443] },
"action": { "type": "block" }
}
],
"default_action": {
"type": "route",
"settings": { "outbound": "proxy" }
}
}
}