Broadcast connection termination event
Refactoring: extracted functions
Added comment; extracted function
Comments
Extracted WebSocket event handler function
Extended README
Avoid double JSON serialization
Separate handlers per event type
Removed dummy output