修改Xray配置

Edit proxy config

推荐使用DoQ接入

修改配置文件

1.开启流量识别

config.json
  "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      }

2.修改出口流量域名分类方式

config.json
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {
        "domainStrategy":"UseIP"
      }
    }
  ]

3.添加DNS分流

修改后请将注释行删除

config.json
   "dns": {
    "servers": [
      "1.1.1.1","8.8.8.8", 
      {
        "address": "quic+local://xxx.core.access.xxxxx.fun:853", 
        "port": 53,
        //如需多个流媒体或域名请按照每个字符串+"," 分隔 如 "geosite:netflix","geosite:disney","domain:dddd.com" 修改后请将此行删除
        "domains": [
           "geosite:netflix"
        ]
      }
    ]
  }

快速配置模板

X-ui 等可用

修改后请将注释行删除

config.json
{
  "api": {
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ],
    "tag": "api"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      },
      "tag": "api"
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "UseIP"
      }
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "policy": {
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    }
  },
  "routing": {
    "rules": [
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      }
    ]
  },
  "dns": {
    "servers": [
      "1.1.1.1",
      "8.8.8.8",
      {
        "address": "https+local://xxx.core.access.xxxxx.fun/dns-query",
        "port": 53,
        //如需多个流媒体或域名请按照每个字符串+"," 分隔 如 ["geosite:netflix","geosite:disney","domain:dddd.com"] 修改后请将此行删除
        "domains": [
          "geosite:netflix"
        ]
      }
    ]
  },
  "stats": {}
}

最后更新于