One handler is not enough
An echo server only ever talks to the client that connected. Anything more interesting — chat, broadcast, presence — needs the server to know about multiple connections at once. The pattern is to introduce a connection manager: a small singleton that tracks open sockets, indexed by whatever your application cares about (room, user, channel).
Minimal viable manager
A dict mapping room name to a set of WebSocket objects covers most cases. Add user-id tracking when you need direct messaging. Add metadata (connected_at, ip) when you need observability. Each addition is incremental.
Always handle dead connections during broadcast
By the time you iterate over the room's set to broadcast, some sockets may already be half-dead (network drop, not yet detected). Every send call must be wrapped — collect dead refs, drop them after the loop, do not mutate the set during iteration.