*event message must pass a MessageEvent
This commit is contained in:
parent
29c6a909b8
commit
4d75c11299
|
@ -57,8 +57,10 @@ export default class Socket extends Duplex {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._emulateWebsocket) {
|
if (this._emulateWebsocket) {
|
||||||
// @ts-ignore
|
this.addEventListener("data", (data: any) =>
|
||||||
this.addEventListener("data", (data: any) => this.emit("message", data));
|
// @ts-ignore
|
||||||
|
this.emit("message", new MessageEvent("data", { data }))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue