Needlessly complicated websocket handling