TL;DR

Reality 是 XTLS 团队 2023 推出的反检测协议,让代理流量与目标网站正常 HTTPS 流量几乎无法区分核心机制:借用 Google / Cloudflare 等知名站点的真实 TLS 证书 + 握手包。优势:不需要自己域名 + 证书。支持:Xray-core(首发)、sing-box、Mihomo。2024 年起是中国大陆反 GFW 的事实标准

VLESS Reality 是 2023-2026 年最重要的代理协议创新。本篇按”它解决什么 / 工作原理 / 配置步骤 / 常见错误”四块讲清楚。

Reality 解决什么问题

2022 年之前主流代理协议:

  • VMess + WS + TLS:自有域名 + 证书,握手特征明显
  • Trojan-TLS:自有域名 + 证书,SNI 易被识别
  • Shadowsocks 2022:流量层加密好但握手层无伪装

共同问题:

  1. 需要自己的域名 + 证书(每年成本 + 暴露身份)
  2. GFW 对所有”已知代理协议”建立了特征库
  3. 握手包模式(即便加密)可以被机器学习识别

Reality 直接绕开这些:

  • 不需要自己的域名 + 证书
  • 借用 Google / Cloudflare 等的真证书 + 握手
  • DPI 看到的是”用户访问 Google”

Reality 的工作原理

简化版:

客户端 → 代理服务器 (VPS)

VPS 与 客户端 进行 TLS 握手,但 TLS 证书是 Google 的

VPS 用 server_name=www.google.com 给客户端发证书

DPI 看到:客户端在访问 Google,证书校验通过

之后所有流量都加密(VLESS 协议)

关键 trick:VPS 自己不需要证书。它发给客户端的证书是 VPS 从真 Google 服务器实时取回来的。

更具体一些:

  1. 客户端发起 TLS ClientHello,SNI 写 www.google.com
  2. VPS 收到后做两件事并发:
    • 把 ClientHello 转发给真的 Google
    • 取回真 Google 的 ServerHello(含真证书)
  3. VPS 把真 ServerHello 返给客户端
  4. 客户端校验证书:通过(因为是真 Google 证书)
  5. 客户端用 public_key 验证 short_id:确认是 Reality 服务端而不是真 Google
  6. 后续数据走 VLESS 加密

DPI 视角:客户端访问 Google,握手正常,证书有效。检测不出代理。

Reality 与同类协议对比

协议需要自己域名需要自己证书DPI 识别难度
Shadowsocks(无 TLS)
VMess + WS + TLS
Trojan-TLS
VLESS Reality极难
XTLS Vision
Hysteria 2中(UDP 易识别)

服务端配置

以 Xray-core 为例:

1. 生成密钥对

xray x25519
# 输出:
# Private key: <private>
# Public key: <public>

xray uuid
# 输出:<your-uuid>

2. 配置 Xray

/usr/local/etc/xray/config.json:

{
  "inbounds": [{
    "port": 443,
    "protocol": "vless",
    "settings": {
      "clients": [{
        "id": "<your-uuid>",
        "flow": "xtls-rprx-vision"
      }],
      "decryption": "none"
    },
    "streamSettings": {
      "network": "tcp",
      "security": "reality",
      "realitySettings": {
        "show": false,
        "dest": "www.cloudflare.com:443",
        "xver": 0,
        "serverNames": ["www.cloudflare.com"],
        "privateKey": "<private>",
        "shortIds": ["", "01ab23cd"]
      }
    }
  }],
  "outbounds": [{"protocol": "freedom"}]
}

3. 启动 + 测试

systemctl restart xray
xray check -config /usr/local/etc/xray/config.json

客户端配置

任何支持 Reality 的客户端(V2RayN / V2RayNG / sing-box / Mihomo / Hiddify / Karing):

{
  "type": "vless",
  "server": "your-vps.com",
  "server_port": 443,
  "uuid": "<your-uuid>",
  "flow": "xtls-rprx-vision",
  "tls": {
    "enabled": true,
    "server_name": "www.cloudflare.com",
    "reality": {
      "enabled": true,
      "public_key": "<public>",
      "short_id": "01ab23cd"
    },
    "utls": {
      "enabled": true,
      "fingerprint": "chrome"
    }
  }
}

或者 vless:// 链接:

vless://<uuid>@your-vps.com:443?type=tcp&security=reality&pbk=<public>&sid=01ab23cd&sni=www.cloudflare.com&flow=xtls-rprx-vision&fp=chrome#JP-Reality

选择 server_name 的策略

选择优点缺点
www.cloudflare.com流量大、不墙、TLS 1.3已被广泛使用,模式可能被建库
www.amazon.com流量大 + 多样化偶尔不稳定
www.microsoft.com极大流量 + 不墙/
www.apple.com不墙 + 流量大/
www.bing.com/国内访问较慢
自有 CDN 域名完全独占被识别风险高

建议:用 cloudflare.com / amazon.com / microsoft.com 之一。轮换 server_name 进一步增强反检测。

Reality 的安全增强(2026/2)

Xray-core v26.2.4 引入:

  • pinnedPeerCertSha256:替代 allowInsecure,强制证书指纹校验
  • mldsa65 抗量子签名:未来兼容
  • utls 指纹随机化:每次连接随机指纹

allowInsecure 在 2026/6/1 UTC 强制下线——所有客户端必须升级到 v26.2.4+ 并迁移到 pinnedPeerCertSha256。详见 Xray 6/1 强制下线 allowInsecure

常见错误

”tls reality handshake failed”

  • 服务端 server_name 与客户端 SNI 不一致
  • public_key 配错
  • short_id 不在服务端列表里

”connection refused”

  • 服务端 Xray 未启动
  • 防火墙拦 443 端口
  • VPS 提供商封锁

连接慢

  • server_name 选了访问慢的目标
  • VPS 到目标网站路由绕远
  • 出口 IP 被运营商限速

跨地区使用 Reality 节点的稳定性

自建 Reality 服务端最大变量是 VPS IP 的纯净度。AWS / GCP 等公有云 IP 容易被识别。建议:

来源与最后核对

本文最后实际验证日期:2026-05-18。