WebSocket constructor with legacy Firefox support.