# VLESS 客户端配置：TLS、REALITY 与 Vision

Source: https://onexray.com/zh/docs/protocols/vless/
Description: 在 OneXray 中导入 VLESS 节点，核对 UUID、传输、TLS 或 REALITY 参数，了解何时需要 Vision。


VLESS 是 OneXray 内置 Xray-core 支持的代理协议。REALITY 是连接安全选项，Vision 是 VLESS 的 flow；它们不是独立的代理协议。请使用服务提供方实际配置的组合。

## 准备服务器资料

需要地址、端口、用户 ID、encryption 和传输参数。使用 TLS 时，确认 server name 以及所需的指纹或 ALPN；使用 REALITY 时，还需公钥、short ID 等参数。连接地址与 TLS server name 不一定相同。

只有服务端要求且与传输兼容时才填写 `xtls-rprx-vision` 等 flow，不要给任意 XHTTP 配置额外添加 Vision。传输参数见 [XHTTP 指南](https://onexray.com/zh/docs/protocols/xhttp/)。

## 导入链接或 JSON

1. [安装 OneXray](https://onexray.com/zh/docs/install/)，进入“服务器 → 添加服务器”。
2. 导入服务提供方的 `vless://` 链接、订阅或节点 JSON 文件。扫描二维码仅支持 iOS 和 Android。
3. 手动编辑 JSON 时，`outbounds` 数组中只保留一个节点，保存前填入全部真实参数。
4. 核对名称与协议标签，在连接页选择该节点；没有特别需求时使用智能路由即可。

现有 TLS 模板使用示例地址与凭据，不是可直接联网的服务器：

[JSON: outbound-vless-tls.json](https://onexray.com/examples/outbound-vless-tls.json)

```json
{
  "outbounds": [
    {
      "tag": "My VLESS server",
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "server.example.com",
            "port": 443,
            "users": [
              {
                "id": "00000000-0000-4000-8000-000000000001",
                "encryption": "none"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "raw",
        "security": "tls",
        "tlsSettings": {
          "serverName": "server.example.com"
        }
      }
    }
  ]
}
```


REALITY 模板需要替换公钥占位符以及其他服务器专属参数：

[JSON: outbound-vless-reality.json](https://onexray.com/examples/outbound-vless-reality.json)

```json
{
  "outbounds": [
    {
      "tag": "My REALITY server",
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "server.example.com",
            "port": 443,
            "users": [
              {
                "id": "00000000-0000-4000-8000-000000000001",
                "encryption": "none"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "raw",
        "security": "reality",
        "realitySettings": {
          "serverName": "cover.example.com",
          "fingerprint": "chrome",
          "password": "REPLACE_WITH_REALITY_PUBLIC_KEY",
          "shortId": "0123456789abcdef"
        }
      }
    }
  ]
}
```


这里的 `realitySettings.password` 保存服务端公钥，不是私钥。字段范围与命名规则见 [outbound 规范](https://onexray.com/zh/docs/configuration/outbound/)。

## 连接失败时如何检查

导入或配置校验通过不代表服务器可达。逐项比对 ID、端口、flow、传输、server name、公钥和 short ID。给节点改名不会修复来自另一台服务器的 REALITY 密钥。

不要通过关闭 TLS 校验来掩盖证书错误。如果节点可用但部分域名无法访问，先检查[路由与 DNS](https://onexray.com/zh/docs/configuration/dns/)，不要随意更换协议参数。[排错指南](https://onexray.com/zh/docs/troubleshooting/)区分导入、配置校验、启动与实际连接失败。

参考：[Xray VLESS 出站](https://xtls.github.io/config/outbounds/vless.html)。


