On this page
Where the site goes: dest, serverNames and sni
Reality has no domain or certificate of its own. A stranger's connection is passed on to the target whole, so a prober sees that real site. For your own client the server still connects to the target and builds its answer on the real handshake. So the target is contacted on every new connection, yours and everybody else's.
On the server the site sits in realitySettings, and the link carries the same name in sni=:
{
"realitySettings": {
"target": "www.example.com:443",
"serverNames": ["www.example.com"],
"privateKey": "…",
"shortIds": ["…"]
}
}dest(targetin newer Xray) — the site and port the server connects to. Current Xray takes either name.serverNames— the names a client may send. Usually one, the same as indest, written exactly: with or withoutwww..sni— in thevless://link, one of theserverNames. In an Xray client config it isserverName, in sing-boxserver_name.
What the site must have
- TLS 1.3 — Reality works only over TLS 1.3. A site that stops at TLS 1.2 can't be borrowed.
- X25519 key exchange — the client offers X25519, as browsers do, and the target has to accept it. Most modern sites do; check rather than assume.
- HTTP/2 (h2) — browsers, and the clients that imitate them, offer h2 first. A site that answers with it looks like an ordinary visit.
- Port 443 and no redirect to another domain — if example.com sends visitors on to www.example.com, take www.example.com. A redirect within the same name, to a language page for example, is fine.
- Close to the server — the server connects to the target on every new connection of every client, so the whole handshake there is added to each one. A distant target adds a pause to every connection, and a page opens many.
- Not on a shared CDN address — if the target's address is a CDN edge that serves all its customers' sites by name, strangers can send other names to your server and reach those sites through it, on your traffic.
Why fame and SNI lists don't decide it
Lists of “the best Reality SNI” and online SNI scanners tell you which sites worked for someone else, from their server, on the day they checked. A site that answers in 5 ms from one data center can take 300 ms from yours, and its TLS settings can change when it moves to another CDN. Fame doesn't help either: a huge site's name at a small hosting provider's address is easier to notice, and a name from a popular list shows up on thousands of servers unrelated to its owner.
Use them for candidates only. Scanners such as XTLS's RealiTLScanner go through addresses, often the ones next to your server's, and print the sites that answer TLS 1.3 with HTTP/2 along with the names in their certificates. Scan from your own computer, not a rented server: a hosting provider can take scanning for abuse. Then check each candidate from the server.
How to check a site from your server
Run these on the server: only its own distance and network matter. Put the candidate in place of www.example.com and compare three to five of them.
xray tls ping www.example.comConnects without SNI, then with it, and prints the TLS version and the certificate's names. With SNI it must succeed over TLS 1.3; a failure without SNI is normal.
curl -so /dev/null --tlsv1.3 --http2 --curves X25519 -w '%{http_version} %{time_appconnect}\n' https://www.example.com/2 0.041 means HTTP/2 and 0.041 seconds until the TLS handshake was done, name lookup and TCP included. 1.1 means no HTTP/2; 0 0.000000 means TLS 1.3 with X25519 failed. Take the lowest of two or three runs: tens of milliseconds is near, hundreds is far. Without --curves, curl is older than 7.73.
curl -so /dev/null -w '%{http_code} %{redirect_url}\n' https://www.example.com/200 with nothing after it: the page opens under this name. 301 or 302 with an address is a redirect; to another domain, check that domain instead.
curl -sI https://www.example.com/ | grep -iE '^(server|via|cf-ray):'Shows who answers. A cf-ray line or server: cloudflare means Cloudflare, where one address serves a great many sites: pick another target.
Switching to another site
Starting from scratch? /tools/reality-keys/ makes keys, a shortId, a server config.json and a vless:// link for the site you type.
- 1
Change the server's settings
Put the new name with
:443intodest(ortarget) and the same name intoserverNames. Check the file withxray run -test -config /usr/local/etc/xray/config.json, then runsystemctl restart xray. - 2
Change sni in every link
Each link needs the new name in
sni=. If clients take links from a panel's subscription, change the site in the panel: the links follow at the next refresh. - 3
Keep everything else
The keys,
shortIds, UUIDs,flowandfpstay as they were. - 4
Check one client
Connect once and read
journalctl -u xray -n 20 --no-pager. A link with the old name is turned away, and the client says reality verification failed.
What you see, the cause and what to do
reality verification failedright after changing the siteCauseThe link still carries the old
sni, which is no longer inserverNamesWhat to doPut the new name into
sniin every link, or refresh the subscriptionEvery client fails with
EOFor a timeout after the changeCauseThe server can't reach the new site, or the site lacks TLS 1.3 with X25519
What to doRun the curl check on the server and pick a site that passes
Each new connection hangs for a moment, then the speed is fine
CauseThe site is far from the server: its handshake is added to every connection
What to doCompare a few candidates and take one in the tens of milliseconds
The site redirects:
301or302to another domainCauseThe name only sends visitors elsewhere
What to doCheck the name it leads to; if that answers
200, use itcf-rayorserver: cloudflarein the headersCauseThe site is behind a CDN address shared by many sites, which strangers can reach through your server
What to doPick a site that isn't behind such a CDN
curl prints
1.1or0 0.000000, xray tls ping shows TLS 1.2CauseNo HTTP/2, TLS 1.2 only, or no X25519
What to doPick another site