Package wsEvents supports an event model when using websockets.