Compare commits

...

2 Commits

Author SHA1 Message Date
Derrick Hammer 603d7c4e14
*update dist 2023-02-25 22:12:36 -05:00
Derrick Hammer 4d75c11299
*event message must pass a MessageEvent 2023-02-25 22:12:05 -05:00
2 changed files with 6 additions and 3 deletions

3
dist/socket.js vendored
View File

@ -27,8 +27,9 @@ class Socket extends streamx_1.Duplex {
this.remoteFamily = type === 6 ? IPV6 : IPV4; this.remoteFamily = type === 6 ? IPV6 : IPV4;
} }
if (this._emulateWebsocket) { if (this._emulateWebsocket) {
this.addEventListener("data", (data) =>
// @ts-ignore // @ts-ignore
this.addEventListener("data", (data) => this.emit("message", data)); this.emit("message", new MessageEvent("data", { data })));
} }
} }
_connecting; _connecting;

View File

@ -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 }))
);
} }
} }