Examples menu

๐Ÿ‘๏ธ Client Monitor

Live dashboard of connected clients with identicons and IPs.

Hook-driven updates โ€” the client list re-renders only when someone connects or disconnects. No polling, no timer, no wasted cycles.
getClients() returns all active SSE connections with their identicon, IP, and connection duration. Open multiple tabs to see them appear.
onClientConnect / onClientDisconnect hooks fire globally. This example broadcasts to the monitor's ROUTE scope inside each hook.
Identicons give each connection a visual fingerprint. They're generated server-side from the session ID โ€” same session always gets the same avatar.
ROUTE scope means every viewer of this page shares the same rendered output. The hook broadcasts once and all clients receive the same HTML patch.
Zero idle cost โ€” unlike a timer, hooks fire only in response to real events. No guard needed to check for active viewers.

Connected Clients (3)

ebb269f3
IP: 127.0.0.1
Connected: 1264s ago
904a609d
IP: 127.0.0.1
Connected: 1076s ago
c56ada53
IP: 127.0.0.1
Connected: 985s ago

๐Ÿ‘ Views

client_monitor.html.twig

Re-renders on connect/disconnect hooks via ROUTE broadcast. Shows identicons, IPs, and connection duration.