Compare commits
2 Commits
29c6a909b8
...
603d7c4e14
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 603d7c4e14 | |
Derrick Hammer | 4d75c11299 |
|
@ -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;
|
||||
|
|
|
@ -57,8 +57,10 @@ export default class Socket extends Duplex {
|
|||
}
|
||||
|
||||
if (this._emulateWebsocket) {
|
||||
// @ts-ignore
|
||||
this.addEventListener("data", (data: any) => this.emit("message", data));
|
||||
this.addEventListener("data", (data: any) =>
|
||||
// @ts-ignore
|
||||
this.emit("message", new MessageEvent("data", { data }))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue