@dnotifier-realtime/dnotifier 1.0.8 → 1.0.10
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
package/src/dnotifier.js
CHANGED
|
@@ -196,7 +196,8 @@ export class DNotifier {
|
|
|
196
196
|
this.appId = appId;
|
|
197
197
|
this.secret = secret;
|
|
198
198
|
this.userId = userId;
|
|
199
|
-
this.url = "ws://
|
|
199
|
+
//this.url = "ws://127.0.0.1:7072";
|
|
200
|
+
this.url = "wss://link.dchatter.com/ws";
|
|
200
201
|
|
|
201
202
|
this.onConnectedCallback = onConnected || (() => {});
|
|
202
203
|
this.onMessageCallback = onMessage || (() => {});
|
|
@@ -238,11 +239,13 @@ export class DNotifier {
|
|
|
238
239
|
appId: this.appId,
|
|
239
240
|
sender: prefixId(this.appId, this.userId),
|
|
240
241
|
timestamp: Date.now(),
|
|
242
|
+
token : this.authToken
|
|
241
243
|
};
|
|
242
244
|
|
|
243
245
|
const payloadBuffer = toUint8(
|
|
244
246
|
JSON.stringify({ token: this.authToken })
|
|
245
247
|
);
|
|
248
|
+
// console.log(this.authToken)
|
|
246
249
|
|
|
247
250
|
const frame = framePacket(metadata, payloadBuffer);
|
|
248
251
|
this.transport.sendBinary(frame);
|
|
@@ -315,6 +318,7 @@ export class DNotifier {
|
|
|
315
318
|
prefixId(this.appId, id)
|
|
316
319
|
),
|
|
317
320
|
timestamp: Date.now(),
|
|
321
|
+
token : this.authToken
|
|
318
322
|
};
|
|
319
323
|
|
|
320
324
|
const payloadBuffer = toUint8(JSON.stringify(data));
|
|
@@ -336,6 +340,7 @@ export class DNotifier {
|
|
|
336
340
|
prefixId(this.appId, id)
|
|
337
341
|
),
|
|
338
342
|
timestamp: Date.now(),
|
|
343
|
+
token : this.authToken
|
|
339
344
|
};
|
|
340
345
|
|
|
341
346
|
const frame = framePacket(metadata, buffer);
|
|
@@ -100,7 +100,7 @@ export class WebsocketTransport extends EventEmitter {
|
|
|
100
100
|
|
|
101
101
|
// 📩 MESSAGE
|
|
102
102
|
this._on("message", async (event, isBinary) => {
|
|
103
|
-
|
|
103
|
+
// console.log('event', event)
|
|
104
104
|
var data = event?.data ?? event;
|
|
105
105
|
|
|
106
106
|
// Convert Blob -> ArrayBuffer in browser
|