Home / Docs / Mirror availability
Mirror availability
Premium client-side mirror probes for RuleSet branches — optional token checks.
A RuleSet branch may list ordered mirrors plus a fallback URL. When that branch wins, lit.onl serves a page loader; the visitor’s browser probes each mirror and opens the first that succeeds, otherwise the fallback.
Requires Growth+ Rules and Premium for the mirror action. In the Rules item editor, open Destination → Mirrors (the ? link lands here).
Why a loader?
A normal server 302 cannot see whether the visitor’s network blocks a destination.
Probes run in the browser on the lit.onl interstitial (after password / confirm-leave when those
apply).
Simple setup (no token)
- Add a mirror HTTPS URL and leave Check on
open(default). - Leave Token empty.
- Ensure the mirror URL is CORS-readable from the browser (or the probe fails and the next mirror / fallback is used).
country in CN -> mirror https://a.example/app else https://fallback.example/ Optional token proof
Use a short random string (not a password) only if you want stronger proof than “URL returned
2xx”. Then set check to well_known, html, or both, and
publish the token:
{ "token": "lit-mrr-9f3a…" } at https://your-origin/.well-known/lit-mirror.json with CORS readable (for example Access-Control-Allow-Origin: *).
Also accepted: a raw JSON string "lit-mrr-9f3a…". Match is exact string equality.
Check modes
open—GETthe mirror URL succeeds with any 2xx (no token). Default when the token is empty.well_known—/.well-known/lit-mirror.jsonmust match (token required).html— page body must contain the token substring (token required).both— try well-known, then HTML (token required). Default when a token is set.
Branch shape
{
"id": "m1",
"when": { "field": "country", "op": "in", "value": ["CN"] },
"url": "https://fallback.example/",
"mirrors": [
{ "url": "https://a.example/app", "token": "org-secret", "check": "both" },
{ "url": "https://b.example/app", "check": "open" }
]
} | Field | Meaning |
|---|---|
url | Required HTTPS fallback after all mirrors fail |
mirrors[].url | Destination to open if the probe succeeds (HTTPS) |
mirrors[].token | Optional shared secret (max 128 chars). Required for well_known / html / both |
mirrors[].check | open · well_known · html · both |
Caps: max 5 mirrors per branch; HTTPS only.
Probe failure
Network error, timeout (~2.5s), non-2xx, missing/mismatched token, or CORS block → try the next mirror, then the branch fallback URL.
Plan gate
| Capability | Free | Core | Growth | Premium |
|---|---|---|---|---|
| Rules library / conditions | — | — | Yes | Yes |
| Mirrors + page loader | — | — | No | Yes |
RediRL
country in CN -> mirror https://a.example/app token "secret" check both, https://b.example/app check open else https://fallback.example/ Full language reference: RediRL.