{
  "log": {
    "disabled": false,
    "level": "info",
    "timestamp": true
  },
  "experimental": {
    "clash_api": {
      "external_controller": "127.0.0.1:9090",
      "external_ui": "metacubexd",
      "external_ui_download_url": "https://gh-proxy.com/https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip",
      "external_ui_download_detour": "direct",
      "default_mode": "rule"
    },
    "cache_file": {
      "enabled": true
    }
  },
  "dns": {
    "servers": [
      {
        "tag": "dns_proxy",
        "type": "https",
        "server": "1.1.1.1",
        "server_port": 443,
        "detour": "自动选择",
        "path": "/dns-query",
        "domain_resolver": "dns_resolver"
      },
      {
        "tag": "dns_direct",
        "type": "h3",
        "server": "dns.alidns.com",
        "server_port": 443,
        "path": "/dns-query",
        "domain_resolver": "dns_resolver"
      },
      {
        "tag": "google",
        "type": "tls",
        "server": "8.8.4.4",
        "domain_resolver": "dns_resolver"
      },
      {
        "tag": "dns_resolver",
        "type": "udp",
        "server": "114.114.114.114"
      },
      {
        "type": "local",
        "tag": "local"
      }
    ],
    "rules": [
      {
        "action": "route",
        "clash_mode": "direct",
        "server": "dns_direct"
      },
      {
        "action": "route",
        "clash_mode": "global",
        "server": "dns_proxy"
      },
      {
        "action": "route",
        "rule_set": "geosite-cn",
        "server": "dns_direct"
      },
      {
        "action": "route",
        "rule_set": "geosite-geolocation-!cn",
        "server": "dns_proxy"
      }
    ],
    "independent_cache": true,
    "strategy": "prefer_ipv4",
    "final": "dns_direct"
  },
  "inbounds": [
    {
      "type": "tun",
      "tag": "tun-in",
      "stack": "system",
      "address": [
        "172.18.0.1/30",
        "fdfe:dcba:9876::1/126"
      ],
      "route_address": [
        "0.0.0.0/1",
        "128.0.0.0/1",
        "::/1",
        "8000::/1"
      ],
      "route_exclude_address": [
        "192.168.0.0/16",
        "10.0.0.0/8",
        "172.16.0.0/12",
        "fc00::/7"
      ],
      "mtu": 9000,
      "auto_route": true,
      "strict_route": true,
      "sniff": true
    },
    {
      "type": "mixed",
      "listen": "127.0.0.1",
      "listen_port": 1082,
      "sniff": true,
      "users": []
    }
  ],
  "outbounds": [
    {
      "type": "urltest",
      "tag": "自动选择",
      "outbounds": [
      ],
      "url": "https://www.gstatic.com/generate_204",
      "interval": "3m",
      "tolerance": 50,
      "interrupt_exist_connections": false
    },
    {
      "type": "selector",
      "tag": "手动切换",
      "outbounds": [
      ]
    },
    {
      "type": "selector",
      "tag": "Telegram",
      "outbounds": [
        "手动切换",
        "自动选择"
      ]
    },
    {
      "type": "selector",
      "tag": "YouTube",
      "outbounds": [
        "手动切换",
        "自动选择"
      ]
    },
    {
      "type": "selector",
      "tag": "netflix",
      "outbounds": [
        "手动切换",
        "自动选择"
      ]
    },
    {
      "type": "selector",
      "tag": "OpenAI",
      "outbounds": [
        "手动切换",
        "自动选择"
      ]
    },
    {
      "type": "selector",
      "tag": "Apple",
      "outbounds": [
        "手动切换",
        "自动选择",
        "direct"
      ]
    },
    {
      "type": "selector",
      "tag": "Google",
      "outbounds": [
        "手动切换",
        "自动选择"
      ]
    },
    {
      "type": "selector",
      "tag": "Microsoft",
      "outbounds": [
        "手动切换",
        "自动选择",
        "direct"
      ]
    },
    {
      "type": "selector",
      "tag": "Github",
      "outbounds": [
        "手动切换",
        "自动选择",
        "direct"
      ]
    },
    {
      "type": "selector",
      "tag": "本地直连",
      "outbounds": [
        "direct",
        "手动切换",
        "自动选择"
      ],
      "default": "direct"
    },
    {
      "tag": "direct",
      "type": "direct"
    }
  ],
  "route": {
    "default_domain_resolver": {
      "server": "dns_resolver",
      "strategy": "prefer_ipv4"
    },
    "rule_set": [
      {
        "tag": "geosite-category-ads-all",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/category-ads-all.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-telegram",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/telegram.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geoip-telegram",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/telegram.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-youtube",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/youtube.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-netflix",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/netflix.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geoip-netflix",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/netflix.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-openai@ads",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/openai@ads.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-openai",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/openai.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-apple",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/apple.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-google",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/google.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geoip-google",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/google.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-microsoft",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/microsoft.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-geolocation-!cn",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/geolocation-!cn.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-github",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/github.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-private",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/private.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geosite-cn",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geosite/cn.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geoip-private",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/private.srs",
        "update_interval": "1d"
      },
      {
        "tag": "geoip-cn",
        "type": "remote",
        "format": "binary",
        "url": "https://gh-proxy.com/https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/cn.srs",
        "update_interval": "1d"
      }
    ],
    "rules": [
      {
        "action": "sniff"
      },
      {
        "protocol": "dns",
        "action": "hijack-dns"
      },
      {
        "ip_is_private": true,
        "outbound": "direct"
      },
      {
        "clash_mode": "global",
        "outbound": "手动切换"
      },
      {
        "clash_mode": "direct",
        "outbound": "本地直连"
      },
      {
        "type": "logical",
        "mode": "or",
        "rules": [
          {
            "rule_set": "geosite-category-ads-all"
          },
          {
            "domain_regex": "^stun\\..+"
          },
          {
            "domain_keyword": [
              "stun",
              "httpdns"
            ]
          },
          {
            "protocol": "stun"
          }
        ],
        "action": "reject",
        "method": "default",
        "no_drop": false
      },
      {
        "rule_set": [
          "geosite-telegram",
          "geoip-telegram"
        ],
        "outbound": "Telegram"
      },
      {
        "rule_set": "geosite-youtube",
        "outbound": "YouTube"
      },
      {
        "rule_set": [
          "geosite-netflix",
          "geoip-netflix"
        ],
        "outbound": "netflix"
      },
      {
        "rule_set": "geosite-openai@ads",
        "action": "reject",
        "method": "default",
        "no_drop": false
      },
      {
        "rule_set": "geosite-openai",
        "outbound": "OpenAI"
      },
      {
        "rule_set": "geosite-apple",
        "outbound": "Apple"
      },
      {
        "rule_set": [
          "geosite-google",
          "geoip-google"
        ],
        "outbound": "Google"
      },
      {
        "rule_set": "geosite-microsoft",
        "outbound": "Microsoft"
      },
      {
        "rule_set": "geosite-github",
        "outbound": "Github"
      },
      {
        "rule_set": "geosite-geolocation-!cn",
        "outbound": "手动切换"
      },
      {
        "rule_set": [
          "geosite-private",
          "geosite-cn",
          "geoip-private",
          "geoip-cn"
        ],
        "outbound": "本地直连"
      }
    ],
    "final": "本地直连",
    "auto_detect_interface": true
  }
}

