Detection of websocket improved