Attach WebSocket listener on join. Format code.