Bead, a demo
A client and a server, over WebSocket or over HTTP, on one port. A client, and its server in a Web Worker of the page: nothing else answers but the files. Each button makes a call; the logs show the call and its envelopes, as the client sees them: → goes out, ← comes in.
State
- Transport
-
WebSocket · HTTP ·
Web Worker, with no server
—
over HTTP, what the server sends of its own comes back by a long poll, a
GETit holds up to 30 s and the page sends again as soon as it returns; in a Web Worker, the Bead server and the identity provider run in the page itself. - Connection
- connecting…
- Identity
- no session
- Counter
- —
- Burst
- —
- Result
- —
- Glyph
- none yet: send one, or receive one
Identity
A fake identity provider signs a JWT; login checks it and keeps its rights
in the session. A read needs a session, a write the write permission.
Calls
Orange border: a write, refused without the permission. Once subscribed, a burst of five increments comes as two notifications of the counter, paced by the protocol — the first, then the latest — and as five signals the page merges into two reads.
Server
Read by a stats call every second, left out of the logs — and counted among
the calls it answers. Each layer shows what it holds, and its ceiling after a slash.
- Health
- —
- Answers
- —
- Holds
Calls, newest first
In the console too, with no reload:
localStorage.setItem('bead:debug', '*'), or a filter such as
d(rx), t(n), -token, and e(notification) for the envelopes;
removeItem stops it. Written when the page is idle, in groups.