Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ runner.node }}
node-version: ${{ matrix.node }}
- run: npm install
- run: npm run build --if-present
- run: npm test
6 changes: 3 additions & 3 deletions lib/client/websocket-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class WebSocketTracker extends Tracker {
this._send(params)
} else {
// Limit the number of offers that are generated, since it can be slow
const numwant = Math.min(opts.numwant, 10)
const numwant = Math.min(opts.numwant, 5)

this._generateOffers(numwant, offers => {
params.numwant = numwant
Expand Down Expand Up @@ -278,17 +278,17 @@ 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) {
const offerId = common.binaryToHex(data.offer_id)
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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bittorrent-tracker",
"description": "Simple, robust, BitTorrent tracker (client & server) implementation",
"version": "9.16.1",
"version": "9.17.0",
"author": {
"name": "WebTorrent LLC",
"email": "[email protected]",
Expand Down