If you run Xray with VLESS + REALITY, you had to pick a target (formerly dest) and serverNames: the real website your server impersonates during the TLS handshake. Most tutorials suggest something big and familiar, like www.microsoft.com, www.apple.com or www.cloudflare.com. We ran six servers on www.cloudflare.com for two months. This post covers why that's a weak choice, how we found better targets for each server, and how we switched without disconnecting a single client.
Why a famous CDN domain is a tell
REALITY works by borrowing a real site's TLS identity. An unauthenticated visitor, including a censor's active probe, gets the target's genuine certificate, passed through untouched. Authenticated clients get the tunnel.
The weak spot is the IP address. Cloudflare, Akamai, Fastly and CloudFront publish their IP ranges, and so does every routing table. A server in a random VPS provider's network that answers TLS handshakes for www.cloudflare.com is an obvious mismatch: that hostname should never live there. A censor doesn't need to break anything. It only needs to compare the SNI with the ASN of the IP it's talking to.
So a good target is:
- a real, stable website that supports TLS 1.3, HTTP/2 (h2) and the X25519 key exchange;
- not behind a CDN, so that the site really lives on a "normal" network;
- close to your server, because REALITY talks to the target during handshakes and its latency adds up;
- ideally in the same ASN as your server, so that the SNI and the IP make sense together;
- not overused: thousands of other REALITY servers already pose as the same five brands.
Step 1: scan your neighbours
The classic advice is to find a TLS 1.3 site in your own hosting network. We scanned the /24 around each of our servers with a small asyncio script:
import asyncio, ssl, ipaddress, sys ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE ctx.minimum_version = ssl.TLSVersion.TLSv1_3 ctx.set_alpn_protocols(["h2", "http/1.1"]) sem = asyncio.Semaphore(40) async def probe(ip): async with sem: try: r, w = await asyncio.wait_for(asyncio.open_connection(ip, 443, ssl=ctx), 4) except Exception: return None so = w.get_extra_info("ssl_object") cert = so.getpeercert(binary_form=True) # parse SANs with `cryptography` w.close() return ip, so.version(), so.selected_alpn_protocol() async def main(prefix): hosts = [str(h) for h in ipaddress.ip_network(prefix).hosts()] for res in await asyncio.gather(*(probe(h) for h in hosts)): if res: print(*res) asyncio.run(main(sys.argv[1])) Run it from the server itself, against your own /24 only, and keep the concurrency low.
The result was surprising. Five of our servers sit with one small hosting provider. Across four /24 networks we found about 300 hosts that speak TLS 1.3, and at least 66 of them presented certificates for big brands: Microsoft, Apple, Yahoo, Samsung, Reddit, Python.org, DuckDuckGo, Hetzner and more. None of those companies host their websites in a small VPS provider's network. These were other people's REALITY servers impersonating the same handful of famous sites.
The rest were small personal projects with Let's Encrypt certificates, a few control panels and default reverse-proxy pages. Nothing stable enough to depend on.
Our sixth server is with a large cloud provider. Its /20 had about 1,500 TLS 1.3 hosts, and the picture was the same: managed-hosting default certificates, Cloudflare origin certificates (those sites resolve to Cloudflare, not to this IP), and more fake www.cloudflare.com, digitalocean.com and twitch.tv.
Lesson: on providers that are popular with VPN operators, "same ASN" is often impossible, and the brands everyone copies are the worst possible choice.
Step 2: test real candidates from the server
Plan B: a real, self-hosted website near each server, not behind a CDN. National research and education networks turned out to be a great source: many universities and research institutes host their sites on their own networks.
For each candidate we checked TLS 1.3 with X25519 and h2 from the server itself:
d=www.example.edu echo | openssl s_client -connect "$d:443" -servername "$d" \ -tls1_3 -groups X25519 -alpn h2 2>/dev/null \ | grep -E "TLSv1.3|ALPN protocol|Verify return code" curl -s -o /dev/null --http2 -w "%{http_code} %{time_appconnect}\n" "https://$d/" Then we looked up who announces the IP with the RIPEstat API:
curl -s "https://stat.ripe.net/data/prefix-overview/data.json?resource=$IP" \ | jq '.data.asns[0]' That step removed most candidates. A lot of university websites are now fronted by Cloudflare, CloudFront, Fastly, Akamai, Imperva or a managed WordPress platform. Of more than 100 sites we tested, only a handful per country passed everything: TLS 1.3, X25519, h2, a valid certificate, self-hosted on the institution's own network, and a low round trip from our server.
Step 3: switch without breaking clients
Changing target and serverNames sounds risky. Clients carry the SNI in their config, and in our case they get it from a subscription that apps refresh every few hours. Change the server first and every client that hasn't refreshed yet loses that connection.
The fix: serverNames is a list. Point target at the new site and keep the old name in the list for a while:
"realitySettings": { "target": "www.new-target.example:443", "serverNames": ["www.new-target.example", "www.cloudflare.com"], "privateKey": "…", "shortIds": ["…"] } Before rolling it out, we tested on one server with a throwaway user and a real Xray client: one client with the old SNI, one with the new. Both connected, over VLESS + REALITY with Vision and over Trojan + REALITY. Then we updated the SNI in the subscription, did the other servers the same way, and scheduled the removal of the old name for a week later, once every client had refreshed.
Finally, check what a censor's probe would see now. Connect without credentials:
echo | openssl s_client -connect YOUR_SERVER_IP:443 \ -servername www.new-target.example -alpn h2 2>/dev/null | grep -E "^subject=|ALPN" You should get the target's genuine certificate and h2, exactly as if you'd visited the real site.
Two things we checked along the way
Vision was already on. Our panel, Remnawave, automatically sets flow: xtls-rprx-vision for VLESS inbounds on raw TCP with REALITY, unless the inbound specifies a flow. We confirmed it in the generated links (flow=xtls-rprx-vision) instead of assuming.
XHTTP is a cheap extra. While we were at it, we added a VLESS + XHTTP + REALITY inbound (mode: auto) on each server, using the same new targets. It helps on networks that cut long-lived TCP connections. Quick single-stream tests through it ranged from about 50 to 500 Mbit/s depending on the server and distance, so it's a usable fallback, not just a last resort.
Checklist
- Don't impersonate a CDN-hosted brand from a non-CDN IP.
- Scan your own /24 first; treat brand certificates on neighbouring VPS IPs as other REALITY servers, not candidates.
- Check TLS 1.3 + X25519 + h2 + a valid certificate from the server itself.
- Check the target's ASN; drop anything behind a CDN.
- Prefer self-hosted sites close to the server; research-network sites are a good pool.
- Switch with both names in
serverNames, test old and new SNI with a real client, drop the old name after clients refresh. - Verify the unauthenticated view with
openssl s_client.
Disclosure: we run HorusVPN, a VPN for networks that block ordinary VPNs, and this is how we maintain our own servers. If you're new to the protocol, our explainer on what VLESS + REALITY is covers the basics.
