*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) {
|
||||
this.addEventListener("data", (data: any) =>
|
||||
// @ts-ignore
|
||||
this.addEventListener("data", (data: any) => this.emit("message", data));
|
||||
this.emit("message", new MessageEvent("data", { data }))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue