basic websocket management, and event registration