@dnotifier-realtime/dnotifier 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -77,6 +77,11 @@ export class WebsocketTransport extends EventEmitter {
|
|
|
77
77
|
return new Promise((resolve, reject) => {
|
|
78
78
|
this.socket = new this.WebSocketImpl(url);
|
|
79
79
|
|
|
80
|
+
// Browser: binary messages as ArrayBuffer
|
|
81
|
+
if (typeof window !== "undefined") {
|
|
82
|
+
this.socket.binaryType = "arrayBuffer";
|
|
83
|
+
}
|
|
84
|
+
|
|
80
85
|
// ✅ OPEN
|
|
81
86
|
this._on("open", () => resolve(true));
|
|
82
87
|
|
|
@@ -95,6 +100,7 @@ export class WebsocketTransport extends EventEmitter {
|
|
|
95
100
|
|
|
96
101
|
// 📩 MESSAGE
|
|
97
102
|
this._on("message", (event, isBinary) => {
|
|
103
|
+
console.log('event', event)
|
|
98
104
|
const data = event?.data ?? event;
|
|
99
105
|
const chunk = decodePacket(data);
|
|
100
106
|
if (chunk) {
|