diff --git a/lib/client/websocket-tracker.js b/lib/client/websocket-tracker.js index 3d0a63b..aab6424 100644 --- a/lib/client/websocket-tracker.js +++ b/lib/client/websocket-tracker.js @@ -247,6 +247,7 @@ WebSocketTracker.prototype._onAnnounceResponse = function (data) { peer.id = common.binaryToHex(data.peer_id) peer.once('signal', function (answer) { var params = { + action: 'announce', info_hash: self.client._infoHashBinary, peer_id: self.client._peerIdBinary, to_peer_id: data.peer_id, diff --git a/server.js b/server.js index 11c8acb..3bf01e1 100644 --- a/server.js +++ b/server.js @@ -369,6 +369,7 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) { debug('got %s peers from swarm %s', peers.length, params.info_hash) peers.forEach(function (peer, i) { peer.socket.send(JSON.stringify({ + action: 'announce', offer: params.offers[i].offer, offer_id: params.offers[i].offer_id, peer_id: common.hexToBinary(params.peer_id), @@ -392,6 +393,7 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) { } toPeer.socket.send(JSON.stringify({ + action: 'announce', answer: params.answer, offer_id: params.offer_id, peer_id: common.hexToBinary(params.peer_id),