Quiz
Twelve questions on the concepts — single answer, select-all, and a few
fill-in-the-blank. Explanations appear after each answer.
Quiz results are saved to your browser's local storage and will persist between sessions.
Reset quiz
A WebSocket connection starts life as…
The handshake is plain HTTP — that's what lets websockets live on the
same port and infrastructure as the rest of the site.
wss:// differs from ws:// in that…
Same protocol, different transport — every frame after the handshake is
identical. Defaults: ws on port 80, wss on 443.
A page loaded over https runs new WebSocket("ws://…"). What happens?
That's why every page in ui/ derives its URL with
location.origin.replace("http", "ws") — http: → ws: and https: →
wss: come out of the same line.
Compared with a webhook subscriber, a websocket subscriber…
(select all that apply)
The socket IS the subscription. The trade: no delivery guarantee — a
socket that's down at broadcast time simply misses the event.
The only place a websocket connection can be authenticated is…
After 101 there are no more requests — just frames on an
already-identified connection. Auth checked after accept() is too
late: the socket is already open.
A client is disconnected when the server broadcasts an event. That event…
Catching up needs machinery on top — an HTTP "events since X" endpoint,
or a webhook if the delivery must land.
How does the server learn that a client has gone away?
Which is exactly why real servers send protocol-level pings — an idle
NAT or proxy can drop a quiet connection silently, and a ghost socket
looks just like a healthy one until you try to use it.
One slow client is stalling Hub.broadcast for everyone. Which fixes
the head-of-line blocking? (select all that apply)
The queue bound is the subtle part — it's what stops a permanently slow
reader from growing memory forever.
ui/ticker.html gets this free from
location.origin.replace("http", "ws") — https: → wss:.
Why does the emitter on /ws/events receive its own broadcast back?
Seeing your own event return is the cheapest possible confirmation the
server accepted it.
The ticker page needs no recovery logic after a reconnect because…
Reconnect + snapshot is the whole recovery story. It works because the
server's state fits in one message — worth remembering when it doesn't.
Quiz Progress
0 / 0 questions answered
(0% )
0 correct
Quiz Complete!
0%
Reset quiz
Answered: 0 / 0
Correct: 0 / 0
Reset