AnyTLS vs ShadowTLS vs Reality: how they differ and which to use

All three run over TCP and look like TLS, but each hides something different. Reality, used with VLESS, answers with a TLS 1.3 handshake under a real site's name, so you need no domain or certificate; ShadowTLS lets a real site do the handshake and then carries an inner protocol, usually Shadowsocks, which does the encryption; AnyTLS runs inside your own TLS and pads the first packets and reuses connections to blur the pattern of TLS inside TLS. Reality works in Xray, sing-box and mihomo, while AnyTLS and ShadowTLS need sing-box or mihomo.

Updated

sing-box config: a full config.json from a subscription

Reality by link, AnyTLS as JSON. A vless:// link with Reality opens in Profiles → Add on Windows, macOS, Linux and Android, and Profiles → Add → “Your own server” installs VLESS Reality on your VPS over SSH.

Download Veli for free
On this page

Side by side

  • Transport

    AnyTLSTCP

    ShadowTLSTCP

    RealityTCP, usually with VLESS

  • Disguise

    AnyTLSYour own TLS; pads the first 8 packets, reuses connections

    ShadowTLSA real site's handshake, then TLS records with a 4-byte HMAC

    RealityTLS 1.3 under a real site's name, with a temporary certificate

  • What a censor sees

    AnyTLSTLS to your domain; a stranger is cut off or sent to a fallback

    ShadowTLSTLS to a third-party site; a stranger is relayed to it

    RealityTLS 1.3 to a third-party name on your IP; a stranger gets that site

  • Speed on lossy links

    AnyTLSTCP; reused sessions save a handshake per new site

    ShadowTLSTCP; Shadowsocks inside, 4 bytes more per record

    RealityTCP; with Vision, inner TLS 1.3 isn't encrypted twice

  • Setup

    AnyTLSA certificate and a password

    ShadowTLSA ShadowTLS server in front of Shadowsocks, a TLS 1.3 site, two passwords

    RealityAn x25519 key pair, short IDs, a target with TLS 1.3 and HTTP/2

  • Clients

    AnyTLSsing-box 1.12+, mihomo; not Xray

    ShadowTLSsing-box, mihomo (a Shadowsocks plugin); not Xray

    RealityXray, sing-box, mihomo

How each one works

Reality takes the place of TLS on the server. The client proves itself inside an ordinary-looking TLS 1.3 ClientHello with the server's x25519 public key and a short ID. A recognised client receives a temporary certificate that only it can check; anyone else is forwarded to the target site and sees that site's real certificate and pages. The project's minimum for a target: a site with TLS 1.3 and HTTP/2 whose domain isn't a redirect. Reality appeared in Xray 1.8.0 in March 2023, and its authors don't recommend pairing it with anything but XTLS, that is VLESS with the Vision flow.

ShadowTLS does no handshake of its own. The server stands between the client and a real site and relays the TLS handshake between them, so a filter sees that site's real certificate. In version 3 the client marks its ClientHello: the last 4 bytes of the 32-byte session ID are an HMAC made with the shared password, and unmarked connections are simply relayed to the site. After the handshake the server takes the connection over: data goes in TLS records, each with a 4-byte HMAC chained from record to record, and a wrong tag ends the connection. ShadowTLS doesn't encrypt your data: its README says encryption isn't its goal, and its example puts a Shadowsocks server behind it.

AnyTLS is the newest of the three: its repository appeared in February 2025. It runs inside an ordinary TLS connection to your server; right after the handshake the client sends a SHA-256 hash of the password and some padding. Inside, it carries many streams and keeps idle sessions for the next request, so a new site doesn't mean a new TLS handshake. A padding scheme sets the sizes of the first packets, by default packets 0 to 7, and the server can push its own scheme to clients. The look of the TLS handshake itself is left to the client's TLS settings, such as a uTLS fingerprint.

What a filter sees: the TLS inside TLS

All three hide the content equally well. What gives a proxy away is shape: when a browser opens an HTTPS site through a TLS proxy, the browser's own TLS handshake travels inside the proxy's TLS, and the sizes and round trips of that inner handshake are typical. Xue and colleagues (USENIX Security 2024) built classifiers for exactly this and ran them for 30 days from March 2023 at Merit, an ISP with over a million users.

  • ShadowTLS with Shadowsocks inside: about 83% of flows detected. Relaying a real handshake doesn't change what comes after it.
  • XTLS Vision, the flow used with Reality: about 51%, with a classifier adapted to its padding of early packets to 900 to 1400 bytes and at a higher rate of false alarms. Reality itself wasn't part of the test.
  • Multiplexing, several connections in one: detection fell to about 13 to 37% of flows. The authors still warn that padding and multiplexing alone can't hide the size of bursts or the number of round trips.
  • AnyTLS appeared after the study and wasn't tested. It combines padding with connection reuse, and its own FAQ lists what remains: the extra round trips of TLS in TLS, bursts of packets right after the handshake, and downstream traffic that isn't padded.

Names, certificates and strangers

The outer handshake differs too. Reality and ShadowTLS show a third-party site's name on your server's IP address, and a careful observer can compare the two; Xray's docs advise borrowing a site from the same network (ASN) as your server. AnyTLS shows your own domain and certificate, which is ordinary, unless the certificate is self-signed and the client skips the check.

A stranger who connects without the key gets the real site from Reality and ShadowTLS. AnyTLS closes the connection or passes it to a fallback web service, if one is set; its FAQ admits that active probing of the server is still possible.

Links and configs

Example
vless://0b6c6f2e-8a1d-4c55-9e3b-2f7d1a4c9e10@203.0.113.10:443?encryption=none&flow=xtls-rprx-vision&security=reality&sni=www.example.com&fp=chrome&pbk=Fq8vT3xR1mZq0cJb7WkLs2nYd9pHa4uEo6iVg5tKx0M&sid=6ba85179e30d4fc2&type=tcp#Reality
  • Reality: security=reality, the public key in pbk, the short ID in sid (up to 16 hex digits), the borrowed name in sni, the browser fingerprint in fp (it must not be left out) and the Vision flow in flow.
  • AnyTLS: a link of its own, anytls://password@vpn.example.com:443/?sni=vpn.example.com, modelled on Hysteria2's. Only sni and insecure are defined, and without a port it is 443.
  • ShadowTLS: no link format; the project doesn't define one. In sing-box it is two outbounds: a shadowtls one with version 3, a password and a tls block with the handshake site's name, and a shadowsocks one whose detour points to it. In mihomo it is a Shadowsocks proxy with the shadow-tls plugin.
  • Versions must match. ShadowTLS v2 and v3 don't talk to each other, and sing-box takes version 1 unless told otherwise.

When to pick which

  • No domain, any client: Reality. No certificate is needed, and Xray, sing-box and mihomo all know it.
  • An app built on Xray only, such as v2rayNG: Reality; Xray has neither AnyTLS nor ShadowTLS.
  • You have a domain and a certificate: AnyTLS is the simplest server of the three, a password and TLS.
  • You already run Shadowsocks: ShadowTLS v3 in front of it adds a real site's handshake. Mind that the reference server's last release, v0.2.25, is from December 2023 and has no Windows build; sing-box has its own implementation.
  • A mihomo client and a new Xray server: mihomo's docs say it won't follow an incompatible Reality change in Xray 26.7.11 and newer, and suggest a sing-box or mihomo server instead.
  • A lossy mobile line: none of the three stands out, since all are TCP. Where UDP gets through, a QUIC protocol such as Hysteria2 copes with loss better.

Sources

How we write and check

In Veli

Reality by link, AnyTLS as JSON

A vless:// link with Reality opens in Profiles → Add on Windows, macOS, Linux and Android, and Profiles → Add → “Your own server” installs VLESS Reality on your VPS over SSH.

AnyTLS goes in only as a sing-box JSON configuration, on Windows, macOS and Linux: anytls:// links aren't accepted, and on Android it doesn't connect. ShadowTLS Veli doesn't connect. On a computer, rules by app and by site in Apps and sites work for Reality and AnyTLS.

FAQ

AnyTLS or Reality: which should I use?

Reality if you have no domain or your app is on Xray: it needs no certificate and every major core knows it. AnyTLS if you have a domain and a sing-box or mihomo client, and want connection reuse and a padding scheme the server can change.

What is the difference between ShadowTLS and Reality?

Both show a real site's name. ShadowTLS relays that site's real handshake and needs an inner protocol such as Shadowsocks; Reality makes its own TLS 1.3 handshake under that name and is used with VLESS.

Does ShadowTLS encrypt traffic?

No. It only authenticates data with an HMAC; the encryption comes from the protocol inside it, usually Shadowsocks.

Which ShadowTLS version should I use?

Version 3: its design addresses the hijacking of connections that v2 didn't. Both ends must use the same version, and in sing-box it has to be set explicitly, since the default is 1.

Can AnyTLS be used with Reality?

Not in mihomo: its docs say the pair isn't supported and won't be, and point to VLESS, VMess or Trojan for Reality.

Do v2rayNG and Xray support AnyTLS or ShadowTLS?

No. Xray's outbounds include VLESS, VMess, Trojan, Shadowsocks, Hysteria and WireGuard, but neither AnyTLS nor ShadowTLS. Use an app built on sing-box or mihomo.

Reality by link, AnyTLS on a computer

Veli is a free client for Windows, macOS, Linux and Android. A vless:// link with Reality opens everywhere; AnyTLS goes in as sing-box JSON on a computer.