abstracting websocket type