mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-31 10:31:36 +00:00
make server and client always send { action: 'announce' }
This commit is contained in:
parent
2fffdc6730
commit
721a7bea7c
@ -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,
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user