Improve websocket endpoint type detection