{
  "log": {
    "disabled": false,
    "level": "info",
    "timestamp": true
  },
  "http_clients": [
    {
      "tag": "ruleset-download",
      "detour": "select"
    }
  ],
  "experimental": {
    "cache_file": {
      "enabled": true,
      "path": "cache.db",
      "store_fakeip": true
    },
    "clash_api": {
      "external_controller": "127.0.0.1:9090",
      "external_ui": "ui",
      "secret": "",
      "default_mode": "rule"
    }
  },
  "dns": {
    "servers": [
      {
        "type": "tls",
        "tag": "proxydns",
        "server": "8.8.8.8",
        "server_port": 853,
        "detour": "select"
      },
      {
        "type": "https",
        "tag": "localdns",
        "server": "223.5.5.5",
        "path": "/dns-query",
        "detour": "select"
      },
      {
        "type": "https",
        "tag": "localdns2",
        "server": "119.29.29.29",
        "path": "/dns-query",
        "detour": "select"
      },
      {
        "type": "fakeip",
        "tag": "dns_fakeip",
        "inet4_range": "198.18.0.0/15",
        "inet6_range": "fc00::/18"
      }
    ],
    "rules": [
      {
        "clash_mode": "Global",
        "server": "proxydns"
      },
      {
        "clash_mode": "Direct",
        "server": "localdns"
      },
      {
        "rule_set": "geosite-cn",
        "server": "localdns"
      },
      {
        "domain_suffix": [
          ".cn"
        ],
        "server": "localdns2"
      },
      {
        "rule_set": "geosite-geolocation-!cn",
        "query_type": [
          "A",
          "AAAA"
        ],
        "server": "dns_fakeip"
      },
      {
        "rule_set": "geosite-geolocation-!cn",
        "server": "proxydns"
      }
    ],
    "final": "proxydns",
    "cache_capacity": 4096
  },
  "inbounds": [
    {
      "type": "tun",
      "tag": "tun-in",
      "address": [
        "172.19.0.1/30",
        "fdfe:dcba:9876::1/126"
      ],
      "auto_route": true,
      "strict_route": true
    }
  ],
  "outbounds": [
    {
      "tag": "select",
      "type": "selector",
      "default": "auto",
      "outbounds": [
        "auto",
        "vless-sb",
        "hy2-sb",
        "tuic5-sb",
        "vmess-sb"
      ],
      "interrupt_exist_connections": false
    },
    {
      "type": "vless",
      "tag": "vless-sb",
      "server": "136.148.76.92",
      "server_port": 443,
      "uuid": "f41443b1-b8fe-441e-96cb-a5d14cbaabb0",
      "flow": "xtls-rprx-vision",
      "packet_encoding": "xudp",
      "tls": {
        "enabled": true,
        "server_name": "download-installer.cdn.mozilla.net",
        "utls": {
          "enabled": true,
          "fingerprint": "chrome"
        },
        "reality": {
          "enabled": true,
          "public_key": "P6dgGmHdkEwQujgTMRu4Hmsq31RiV9sDalWirDBMFEs",
          "short_id": "bdea5e84"
        }
      }
    },
    {
      "type": "vmess",
      "tag": "vmess-sb",
      "server": "136.148.76.92",
      "server_port": 443,
      "uuid": "f41443b1-b8fe-441e-96cb-a5d14cbaabb0",
      "security": "auto",
      "alter_id": 0,
      "packet_encoding": "packetaddr",
      "tls": {
        "enabled": true,
        "server_name": "ra154.bdfz.net",
        "insecure": false
      },
      "transport": {
        "type": "ws",
        "path": "/jyvp36tVZNGW9Vfpj0rFxgSs",
        "headers": {
          "Host": "ra154.bdfz.net"
        },
        "max_early_data": 2048,
        "early_data_header_name": "Sec-WebSocket-Protocol"
      }
    },
    {
      "type": "hysteria2",
      "tag": "hy2-sb",
      "server": "136.148.76.92",
      "server_ports": [
        "46239:46318"
      ],
      "hop_interval": "30s",
      "password": "f41443b1-b8fe-441e-96cb-a5d14cbaabb0",
      "obfs": {
        "type": "salamander",
        "password": "l4ElMAYrLl2oH4VRAMxE"
      },
      "tls": {
        "enabled": true,
        "server_name": "ra154.bdfz.net",
        "insecure": false,
        "alpn": [
          "h3"
        ]
      }
    },
    {
      "type": "tuic",
      "tag": "tuic5-sb",
      "server": "136.148.76.92",
      "server_port": 41259,
      "uuid": "f41443b1-b8fe-441e-96cb-a5d14cbaabb0",
      "password": "f41443b1-b8fe-441e-96cb-a5d14cbaabb0",
      "congestion_control": "bbr",
      "udp_relay_mode": "native",
      "zero_rtt_handshake": false,
      "heartbeat": "10s",
      "tls": {
        "enabled": true,
        "server_name": "ra154.bdfz.net",
        "insecure": false,
        "alpn": [
          "h3"
        ]
      }
    },
    {
      "tag": "direct",
      "type": "direct"
    },
    {
      "tag": "auto",
      "type": "urltest",
      "outbounds": [
        "vless-sb",
        "hy2-sb",
        "tuic5-sb",
        "vmess-sb"
      ],
      "url": "https://1.1.1.1/cdn-cgi/trace",
      "interval": "3m",
      "tolerance": 100,
      "idle_timeout": "30m",
      "interrupt_exist_connections": false
    }
  ],
  "route": {
    "default_http_client": "ruleset-download",
    "default_domain_resolver": {
      "server": "proxydns"
    },
    "rule_set": [
      {
        "tag": "geosite-geolocation-!cn",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/c8f7c90a1e3d834c0415202ccd85a8dfc1053165/geo/geosite/geolocation-!cn.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-cn",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/c8f7c90a1e3d834c0415202ccd85a8dfc1053165/geo/geosite/geolocation-cn.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geoip-cn",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/c8f7c90a1e3d834c0415202ccd85a8dfc1053165/geo/geoip/cn.srs",
        "update_interval": "1d"
      }
    ],
    "auto_detect_interface": true,
    "final": "select",
    "rules": [
      {
        "inbound": "tun-in",
        "action": "sniff"
      },
      {
        "type": "logical",
        "mode": "or",
        "rules": [
          {
            "protocol": "dns"
          },
          {
            "port": 53
          }
        ],
        "action": "hijack-dns"
      },
      {
        "type": "logical",
        "mode": "or",
        "rules": [
          {
            "port": 853
          },
          {
            "network": "udp",
            "port": 443
          },
          {
            "protocol": "stun"
          }
        ],
        "action": "reject"
      },
      {
        "ip_is_private": true,
        "outbound": "direct"
      },
      {
        "clash_mode": "Direct",
        "outbound": "direct"
      },
      {
        "clash_mode": "Global",
        "outbound": "select"
      },
      {
        "rule_set": "geoip-cn",
        "outbound": "direct"
      },
      {
        "rule_set": "geosite-cn",
        "outbound": "direct"
      },
      {
        "rule_set": "geosite-geolocation-!cn",
        "outbound": "select"
      }
    ]
  }
}
