@freesignal/socketio 0.1.4 → 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 CHANGED
@@ -44,13 +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) => { this.open(data); });
54
56
  this.socket.on('disconnect', () => {
55
57
  this.onClose();
56
58
  this.socket = undefined;
package/dist/server.js CHANGED
@@ -58,7 +58,7 @@ export class FreeSignalServer extends FreeSignalSocketio {
58
58
  callback(null, true);
59
59
  },*/
60
60
  origin: '*',
61
- methods: ["GET", "POST"]
61
+ //methods: ["GET", "POST"]
62
62
  }
63
63
  });
64
64
  this.wss.on('connection', (socket) => __awaiter(this, void 0, void 0, function* () {
@@ -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
- else
77
+ }
78
+ else {
78
79
  this.sendHandshake(userId);
80
+ }
79
81
  }));
80
82
  return this;
81
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freesignal/socketio",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Socket.io trasnport package for FreeSignal protocol",
5
5
  "homepage": "https://github.com/christianbraghette/freesignal-socketio#readme",
6
6
  "bugs": {