diff --git a/packages/engine.io-client/lib/transports/websocket.node.ts b/packages/engine.io-client/lib/transports/websocket.node.ts index 83777991c..c587cceb7 100644 --- a/packages/engine.io-client/lib/transports/websocket.node.ts +++ b/packages/engine.io-client/lib/transports/websocket.node.ts @@ -1,4 +1,4 @@ -import { WebSocket } from "ws"; +import * as ws from "ws"; import type { Packet, RawData } from "engine.io-parser"; import { BaseWS } from "./websocket.js"; @@ -27,7 +27,7 @@ export class WS extends BaseWS { opts.headers.cookie.push(`${name}=${cookie.value}`); } } - return new WebSocket(uri, protocols, opts); + return new ws.WebSocket(uri, protocols, opts); } doWrite(packet: Packet, data: RawData) {