@freesignal/socketio 0.1.5 → 0.1.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/dist/client.js +3 -4
- package/dist/server.js +4 -2
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -44,16 +44,15 @@ export class FreeSignalClient extends FreeSignalSocketio {
|
|
|
44
44
|
userId: this.userId.toString()
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
+
this.socket.on(TransportEvent.MESSAGE, (data) => {
|
|
48
|
+
this.open(new Uint8Array(data));
|
|
49
|
+
});
|
|
47
50
|
this.socket.on(TransportEvent.HANDSHAKE, (userId) => __awaiter(this, void 0, void 0, function* () {
|
|
48
51
|
this._serverId = userId;
|
|
49
52
|
yield this.waitHandshaked(userId);
|
|
50
53
|
yield this.flushOutbox();
|
|
51
54
|
resolve();
|
|
52
55
|
}));
|
|
53
|
-
this.socket.on(TransportEvent.MESSAGE, (data) => {
|
|
54
|
-
console.log(data);
|
|
55
|
-
this.open(new Uint8Array(data));
|
|
56
|
-
});
|
|
57
56
|
this.socket.on('disconnect', () => {
|
|
58
57
|
this.onClose();
|
|
59
58
|
this.socket = undefined;
|
package/dist/server.js
CHANGED
|
@@ -72,10 +72,12 @@ export class FreeSignalServer extends FreeSignalSocketio {
|
|
|
72
72
|
socket.on(TransportEvent.MESSAGE, (data) => this.open(data));
|
|
73
73
|
socket.on('disconnect', () => this.connections.delete(userId));
|
|
74
74
|
socket.emit(TransportEvent.HANDSHAKE, this.userId.toString());
|
|
75
|
-
if (!(yield this.sessions.has(userId)))
|
|
75
|
+
if (!(yield this.sessions.has(userId))) {
|
|
76
76
|
this.sendBootstrap(userId);
|
|
77
|
-
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
78
79
|
this.sendHandshake(userId);
|
|
80
|
+
}
|
|
79
81
|
}));
|
|
80
82
|
return this;
|
|
81
83
|
}
|
package/package.json
CHANGED