English
REALITY (tls.reality)
REALITY is an Xray protocol over TLS 1.3: the server holds no certificate of its own, and for outside connections it transparently proxies a real site (handshake). The client proves it knows the key in the session ID of the ClientHello and checks that it is this very server that answered. The reality block is written inside tls; enabled is not written.
Compatible with Xray and sing-box (keys are X25519 in base64url, as with xray x25519).
Inbound
| Field | Type | Default | Meaning |
|---|---|---|---|
handshake.server | host:port | required | The site the server masquerades as |
private_key | string | required | The X25519 private key, base64url |
short_id | list of hex strings | [""] | Accepted short IDs, each up to 8 bytes (16 hex characters) |
max_time_difference | duration | no check | The allowed difference between the client's and the server's clocks |
mldsa65_seed | string | — | The seed of an ML-DSA-65 key, base64url (Xray mldsa65Seed): the server signs every handshake with it |
handshake.server is written with the port: a separate server_port is an error with a hint, an address without a port is reality.handshake: `server` is `host:port` .
The server's tls.sni is the name accepted from the client.
Server restrictions: certificate*, key*, curve_preferences, ech cannot be set in tls; handshake has no dial fields (detour, interface and the like give reality.handshake: dialer options are not implemented yet).
Outbound
| Field | Type | Default | Meaning |
|---|---|---|---|
public_key | string | required | The server's X25519 public key, base64url |
short_id | hex string | "" | One of the server's short IDs |
mldsa65_verify | string | — | The server's ML-DSA-65 public key, base64url (Xray mldsa65Verify): without its signature the server is not accepted |
A REALITY client requires the tls.utls block: without it, reality needs `utls`, as `utls: {fingerprint: chrome}` . verify_names, certificate_sha256 and spoof cannot be used with REALITY; disable_sni only together with insecure. The certificate the server shows is checked against the system store, not against the certificate* fields of the tls block.
Post-quantum protection
Key exchange. The chrome, firefox and randomized fingerprints offer the hybrid group X25519MLKEM768 along with X25519; an Xray server accepts only such a ClientHello, while the REALITY server here and in sing-box also accepts a ClientHello with X25519 alone. The server picks the group that the handshake site picked.
Signature. A server with mldsa65_seed puts an ML-DSA-65 signature of both hellos of the handshake into its certificate, as Xray does; a client with mldsa65_verify does not accept a server without a valid signature, and a client without it checks only the HMAC. The key pair comes from xray mldsa65: Seed for the server, Verify for the clients. mldsa65_seed cannot be the same as private_key. The signature adds ~3.3 KB to the certificate; if the handshake site's certificate record is shorter, the handshake fails (handshake longer than the site's).
The client sets a timestamp in the ClientHello, and the server checks it against max_time_difference, using the ntp time if that section is present.
REALITY does not work over QUIC. The usual use is VLESS with flow: xtls-rprx-vision without a transport.
Example
Server:
yaml
inbounds:
reality-in:
vless:
listen: ":443"
users:
- name: alice
uuid: b831381d-6324-4d53-ad4f-8cda48b30811
flow: xtls-rprx-vision
tls:
sni: www.example.com
reality:
handshake:
server: www.example.com:443
private_key: SNfL-4rkF6mCzsOtOyo5-4k9mPbc1ASydCIK69G5vXU
short_id: ["0123456789abcdef"]
max_time_difference: 1m
mldsa65_seed: 5sF0Vxp6dDscVVGF4MyGoL7tnhHe5masMuIiOj-bbn8
outbounds:
direct:
direct:
route:
final:
outbound: directClient:
yaml
outbounds:
reality:
vless:
server: de.example.com:443
uuid: b831381d-6324-4d53-ad4f-8cda48b30811
flow: xtls-rprx-vision
tls:
sni: www.example.com
utls:
fingerprint: chrome
reality:
public_key: zEb3mQCQL9TQiNCyIDDPXYyJt1_ksA_WqsVztEINyV0
short_id: "0123456789abcdef"
mldsa65_verify: 5h0Hr878Trwt991ud58a6riYQdMyys-kDbnqPa7b1y1CtKNBNFS22sgNZy7jG1edGrsEFuA5L4htzOn44R_ErKt0YFBMb1EyFBWFpuY-MCMs4MbL1BKLgxVqYCzQPERtxXCvuSTWBki7x3PK9In1NyffiTAbvuCXGofFrjK-U43VoBnyqJoCmZOvt2mO0kC2N5thAn07BbYQwj7Shpb4AEx6b5jaUUiJ4wRvTDo8IJ1JC9BKMbt3FHwhyfHklQYs-BY-OykYdBdnaljkW51SGi4VMwTklY0aS9zoXGNIGJBrqwkBpBxCEZ_j8lvpoDWzzS69tlPRxtEfPgexW5nxY3ER87hKBUto3XqjJLpOfZbyGI92Z3P_pqGNZAqbhLU5p5t3VKHW6ZyzPQxFm9QQPfkeIMJ15_3G-11CxVO9BDUWCEEbzSTu0-FktTFhNKJKzoXxB3C8CS9PE4rZR1k-tHTjGp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-2xy-FTtfbD3qBXa2X7wLnI1HA9D65QKrtGlSY7fC1AW4EhfNMQIL8BBqmqYowF090i6AzkX1tPHSB_MZePsSHBiMBseoZjFn3gMNwSJY4h0GksfnGToabQ-4dF6MyC_-_P5DsV-YZcYzETSM0R2aBqFx8Dvstv-L8M8Zi3D4f37uoHSo9BJKbzwEV7qfTGuJSkr41N84_p8hHGYMGK8-JX2vT8ft5dSoMLhTDWyu97hmhTSYXdThY6DZwcVq_i74Owd0jvBcH6Y00WlxnBzkK9gBnPGpWSQ-vAO1liu-PYh_73QtcJ12Ewx8gDn9crHOdeEEBUiJQLz0rlGIbCdYNscguFX1RHk7AkI9mqaBoESeuzjDMQqcjd7bEyGdM3VxgP6BVGVKjW4gBjW9_z5_SOeD5epZTWkeyRxfFXD20hzpsINVdrdxpxGI04y46_v5uBgo9KMhJIUkX3C8HPBQaAfzICKIxFoZobZ1DUSH3jIskwqjVj7eT-94ozzzaQ7eFrPP8jnZkCOIBpXqOlWndew_eDGd1ZkiKdAvB4ZOQ84oH4mn1jE-8H96N-aeoSiEYBzSimdpK58q_ni6DC_Eg-claGrBW-ayR2AFFo_t8VOXPqbtfKk8MqxSntc3aYB8sGD2SAmRmJ7Hikv7uRSPeZPu3yOX7K3UtfOfuCkxrZlx1ILuqDHJtoOpOIpGzi16Nnihi_11qBCQVMN2Zi7ztc9XBmUGVs5birNigHnqiPQnmh_OFTV7evrvnjNKzU2nGvboZx72idxSQIOo4z17o8bflmVWM59lxtsARMjDH9WawHjGvKwDnuOVBN31yT0rvWDpSWyxZK1avM6r67_SpXDiXm5vGtSOdYfWaRTDrVdq215Uv9ry1iRyP9UlO9CiOFKsMAdXkhYeG80_ZabuzAzCucRCtSUZLkUsilWxm2uau-2Y21DTMAfZhgz_Fh4nDOZhZzAWuGGLkYYIF2uTXoApsEKs9hQLYWS6MhacRTIF1Yh9UzzLtXR-GMtX4gr5YIM
route:
final:
outbound: realityThe keys in the examples are for demonstration; generate a new pair for your own server.