diff --git a/lib/client/websocket-tracker.js b/lib/client/websocket-tracker.js index 6e71e76..815b034 100644 --- a/lib/client/websocket-tracker.js +++ b/lib/client/websocket-tracker.js @@ -278,8 +278,8 @@ class WebSocketTracker extends Tracker { if (this._trackerId) params.trackerid = this._trackerId this._send(params) }) - peer.signal(data.offer) this.client.emit('peer', peer) + peer.signal(data.offer) } if (data.answer && data.peer_id) { @@ -287,8 +287,8 @@ class WebSocketTracker extends Tracker { peer = this.peers[offerId] if (peer) { peer.id = common.binaryToHex(data.peer_id) - peer.signal(data.answer) this.client.emit('peer', peer) + peer.signal(data.answer) clearTimeout(peer.trackerTimeout) peer.trackerTimeout = null