diff --git a/dist/socket.js b/dist/socket.js index 01d94f7..16fd673 100644 --- a/dist/socket.js +++ b/dist/socket.js @@ -27,8 +27,9 @@ class Socket extends streamx_1.Duplex { this.remoteFamily = type === 6 ? IPV6 : IPV4; } if (this._emulateWebsocket) { + this.addEventListener("data", (data) => // @ts-ignore - this.addEventListener("data", (data) => this.emit("message", data)); + this.emit("message", new MessageEvent("data", { data }))); } } _connecting;