track open/close/error event from js WebSocket