Skip to content

Commit 721a7be

Browse files
committed
make server and client always send { action: 'announce' }
1 parent 2fffdc6 commit 721a7be

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/client/websocket-tracker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ WebSocketTracker.prototype._onAnnounceResponse = function (data) {
247247
peer.id = common.binaryToHex(data.peer_id)
248248
peer.once('signal', function (answer) {
249249
var params = {
250+
action: 'announce',
250251
info_hash: self.client._infoHashBinary,
251252
peer_id: self.client._peerIdBinary,
252253
to_peer_id: data.peer_id,

server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) {
369369
debug('got %s peers from swarm %s', peers.length, params.info_hash)
370370
peers.forEach(function (peer, i) {
371371
peer.socket.send(JSON.stringify({
372+
action: 'announce',
372373
offer: params.offers[i].offer,
373374
offer_id: params.offers[i].offer_id,
374375
peer_id: common.hexToBinary(params.peer_id),
@@ -392,6 +393,7 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) {
392393
}
393394

394395
toPeer.socket.send(JSON.stringify({
396+
action: 'announce',
395397
answer: params.answer,
396398
offer_id: params.offer_id,
397399
peer_id: common.hexToBinary(params.peer_id),

0 commit comments

Comments
 (0)