找回密码
 立即注册
查看: 94|回复: 4

【已解决】Xray 如何修改配置文件禁止访问国内IP

[复制链接]

1881

主题

0

回帖

1881

积分

金牌会员

积分
1881
发表于 2023-7-17 13:20:04 | 显示全部楼层 |阅读模式
尝试修改了一下配置文件 xray 报错说是旧的配置方式不推荐了 想问一下如何修改

{
  "log": {
    "access": "none",
    "loglevel": "none"
  },
  "dns": {},
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "type": "field",
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "block"
      }
    ]
  },
  "policy": {},
  "inbounds": [
    {
      "port": 443,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "password",
            "flow": "xtls-rprx-vision,none"
          }
        ],
        "decryption": "none",
        "fallbacks": [
          {
            "dest": 1310,
            "xver": 1
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "tls",
        "tlsSettings": {
          "rejectUnknownSni": true,
          "minVersion": "1.2",
          "certificates": [
            {
              "ocspStapling": 3600,
              "certificateFile": "/usr/local/etc/xray/ssl/xray_ssl.crt",
              "keyFile": "/usr/local/etc/xray/ssl/xray_ssl.key"
            }
          ]
        }
      }
    },
    {
      "port": 1310,
      "listen": "127.0.0.1",
      "protocol": "trojan",
      "settings": {
        "clients": [
          {
            "password": "password"
          }
        ],
        "fallbacks": [
          {
            "dest": 8080
          }
        ]
      },
      "streamSettings": {
        "network": "tcp",
        "security": "none",
        "tcpSettings": {
          "acceptProxyProtocol": true
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "tag": "block"
    }
  ],
  "transport": {},
  "stats": {},
  "reverse": {}
}
回复

使用道具 举报

0

主题

928

回帖

0

积分

新手上路

积分
0
发表于 2023-7-17 13:24:08 | 显示全部楼层
//direct 国内流量屏蔽
      {
        "type": "field",
        "domain": ["geosite:cn", "full:direct.yourdomain.com"],
        "outboundTag": "block"
      },
回复 支持 反对

使用道具 举报

0

主题

995

回帖

0

积分

新手上路

积分
0
发表于 2023-7-17 13:31:07 | 显示全部楼层
geoip:cn丢到blackhole就好了
回复 支持 反对

使用道具 举报

0

主题

1053

回帖

0

积分

新手上路

积分
0
发表于 2023-7-17 13:34:14 | 显示全部楼层
感谢:D
回复 支持 反对

使用道具 举报

0

主题

941

回帖

0

积分

新手上路

积分
0
发表于 2023-7-17 13:35:19 | 显示全部楼层
可以了 感谢:D
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|翻墙党

GMT+8, 2026-9-29 12:31 , Processed in 0.073596 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表