{
  "routing": {
    "rules": [
      // Capture DNS
      {
        "inboundTag": ["redirect", "tproxy"],
        "outboundTag": "dns",
        "type": "field",
        "port": 53
      },
      // Block QUIC
      {
        "inboundTag": ["redirect", "tproxy"],
        "outboundTag": "block",
        "type": "field",
        "protocol": ["quic"]
      },
      // Force specific source IPs to go direct
      {
        "inboundTag": ["redirect", "tproxy"],
        "outboundTag": "direct",
        "type": "field",
        "source": [
          "192.168.2.255",
          "192.168.2.254"
        ]
      },
      // Block common ads and other stuff
      {
        "inboundTag": ["redirect", "tproxy"],
        "outboundTag": "block",
        "type": "field",
        "domain": [
          "geosite:category-ads-all",
          "google-analytics",
          "analytics.yandex",
          "appcenter.ms",
          "app-measurement.com",
          "firebase.io",
          "crashlytics.com"
        ]
      },
      // Force BitTorrent to go through direct
      {
        "inboundTag": ["redirect", "tproxy"],
        "outboundTag": "direct",
        "type": "field",
        "protocol": ["bittorrent"]
      },     
      // Explicitly force direct
      {
        "inboundTag": ["redirect", "tproxy"],
        "outboundTag": "direct",
        "type": "field",
        "domain": [
          "regexp:^([\\w\\-\\.]+\\.)ru$",  // .ru
          "regexp:^([\\w\\-\\.]+\\.)su$",  // .su
          "regexp:^([\\w\\-\\.]+\\.)xn--p1ai$",  // .рф
          "regexp:^([\\w\\-\\.]+\\.)xn--p1acf$",  // .рус
          "regexp:^([\\w\\-\\.]+\\.)xn--80asehdb$",  // .онлайн
          "regexp:^([\\w\\-\\.]+\\.)xn--c1avg$", // .орг
          "regexp:^([\\w\\-\\.]+\\.)xn--80aswg$",  // .сайт
          "regexp:^([\\w\\-\\.]+\\.)xn--80adxhks$",  // .москва
          "regexp:^([\\w\\-\\.]+\\.)moscow$",  //  .moscow
          "regexp:^([\\w\\-\\.]+\\.)xn--d1acj3b$",  // .дети
          "regexp:^([\\w\\-\\.]+\\.)yandex$",  // .yandex
          "geosite:category-ru",
          "geosite:category-gov-ru",
          "geosite:yandex",
          "geosite:steam",
          "geosite:vk",
          "geosite:category-gov-ru",
          "regexp:^assets(\\d*?)\\.xboxlive\\.com$",
          "domain:rt.ru",
          "domain:ngenix.net",
          "domain:plex.tv",
          "geoip:ru",
          "domain:kaspersky.com",
          "domain:koronapay.com",
          "domain:binance.com",
          "domain:raiffeisen.ru",
          "geosite:xiaomi",
          "geosite:mihoyo",
          "domain:xsolla.com",
          "domain:download.developer.apple.com",
          // "domain:aeza.net",
          "domain:veesp.com"
        ]
      },

      // No rules found? Go vless-reality
      {
        "inboundTag": ["redirect", "tproxy"],
        "outboundTag": "vless-reality",
        "type": "field"
      }
    ]
  }
}
