diff --git a/AUTHORS.md b/AUTHORS.md index 904c5d34..acf8e9f7 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -49,5 +49,6 @@ - Eric Guan (guanzo91@gmail.com) - Koushik Dutta (koush@koushikdutta.com) - KayleePop (34007889+KayleePop@users.noreply.github.com) +- Diego Rodriguez Baquero (diego.baquero@pager.com) #### Generated by tools/update-authors.sh. diff --git a/index.js b/index.js index 1e7f2a45..de5d73c7 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +/*! bittorrent-tracker. MIT License. WebTorrent LLC */ const Client = require('./client') const Server = require('./server') diff --git a/package.json b/package.json index 2d1be7ba..fe7d8a3b 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "bittorrent-tracker", "description": "Simple, robust, BitTorrent tracker (client & server) implementation", - "version": "9.14.5", + "version": "9.15.0", "author": { - "name": "WebTorrent, LLC", + "name": "WebTorrent LLC", "email": "feross@webtorrent.io", "url": "https://webtorrent.io" }, @@ -38,9 +38,9 @@ "randombytes": "^2.1.0", "run-parallel": "^1.1.9", "run-series": "^1.1.8", - "simple-get": "^3.1.0", + "simple-get": "^4.0.0", "simple-peer": "^9.7.1", - "simple-websocket": "^8.1.1", + "simple-websocket": "^9.0.0", "string2compact": "^1.3.0", "unordered-array-remove": "^1.0.2", "ws": "^7.3.0" @@ -78,5 +78,19 @@ "scripts": { "test": "standard && tape test/*.js", "update-authors": "./tools/update-authors.sh" - } + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] } diff --git a/test/client-large-torrent.js b/test/client-large-torrent.js index 00a62c21..7820216a 100644 --- a/test/client-large-torrent.js +++ b/test/client-large-torrent.js @@ -11,7 +11,7 @@ function testLargeTorrent (t, serverType) { common.createServer(t, serverType, function (server, announceUrl) { var client = new Client({ infoHash: fixtures.sintel.parsedTorrent.infoHash, - peerId: peerId, + peerId, port: 6881, announce: announceUrl, wrtc: {} diff --git a/test/client-magnet.js b/test/client-magnet.js index bb768eab..994473ee 100644 --- a/test/client-magnet.js +++ b/test/client-magnet.js @@ -15,7 +15,7 @@ function testMagnet (t, serverType) { var client = new Client({ infoHash: parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) diff --git a/test/client-ws-socket-pool.js b/test/client-ws-socket-pool.js index a87619f9..04ed642c 100644 --- a/test/client-ws-socket-pool.js +++ b/test/client-ws-socket-pool.js @@ -13,8 +13,8 @@ test('ensure client.destroy() callback is called with re-used websockets in sock var client1 = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, - port: port, + peerId, + port, wrtc: {} }) @@ -30,8 +30,8 @@ test('ensure client.destroy() callback is called with re-used websockets in sock var client2 = new Client({ infoHash: fixtures.alice.parsedTorrent.infoHash, // different info hash announce: announceUrl, - peerId: peerId, - port: port, + peerId, + port, wrtc: {} }) diff --git a/test/client.js b/test/client.js index e622c1ab..f1c8cef3 100644 --- a/test/client.js +++ b/test/client.js @@ -16,7 +16,7 @@ function testClientStart (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -62,7 +62,7 @@ function testClientStop (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -110,7 +110,7 @@ function testClientStopDestroy (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -164,7 +164,7 @@ function testClientUpdate (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -217,7 +217,7 @@ function testClientScrape (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -259,7 +259,7 @@ function testClientAnnounceWithParams (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -307,7 +307,7 @@ function testClientGetAnnounceOpts (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, getAnnounceOpts: function () { return { testParam: 'this is a test' @@ -358,7 +358,7 @@ function testClientAnnounceWithNumWant (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: [announceUrl], peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -449,7 +449,7 @@ test('http: userAgent', function (t) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, userAgent: 'WebTorrent/0.98.0 (https://webtorrent.io)', wrtc: {} }) @@ -476,7 +476,7 @@ function testSupportedTracker (t, serverType) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) @@ -514,7 +514,7 @@ function testUnsupportedTracker (t, announceUrl) { infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, peerId: peerId1, - port: port, + port, wrtc: {} }) diff --git a/test/destroy.js b/test/destroy.js index 5437b8ac..57aa0b9b 100644 --- a/test/destroy.js +++ b/test/destroy.js @@ -13,8 +13,8 @@ function testNoEventsAfterDestroy (t, serverType) { var client = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, - port: port, + peerId, + port, wrtc: {} }) diff --git a/test/evict.js b/test/evict.js index 3cab3a76..196a8f28 100644 --- a/test/evict.js +++ b/test/evict.js @@ -16,7 +16,7 @@ function serverTest (t, serverType, serverFamily) { : '127.0.0.1' var opts = { - serverType: serverType, + serverType, peersCacheLength: 2 // LRU cache can only contain a max of 2 peers } @@ -27,11 +27,11 @@ function serverTest (t, serverType, serverFamily) { var announceUrl = serverType + '://' + hostname + ':' + port + '/announce' var client1 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], - peerId: peerId, + peerId, port: 6881, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client1) @@ -39,11 +39,11 @@ function serverTest (t, serverType, serverFamily) { client1.once('update', function (data) { var client2 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], peerId: peerId2, port: 6882, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client2) @@ -64,11 +64,11 @@ function serverTest (t, serverType, serverFamily) { }) var client3 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], peerId: peerId3, port: 6880, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client3) diff --git a/test/filter.js b/test/filter.js index 395e2336..386f17a7 100644 --- a/test/filter.js +++ b/test/filter.js @@ -8,7 +8,7 @@ var peerId = Buffer.from('01234567890123456789') function testFilterOption (t, serverType) { t.plan(8) - var opts = { serverType: serverType } // this is test-suite-only option + var opts = { serverType } // this is test-suite-only option opts.filter = function (infoHash, params, cb) { process.nextTick(function () { if (infoHash === fixtures.alice.parsedTorrent.infoHash) { @@ -23,7 +23,7 @@ function testFilterOption (t, serverType) { var client1 = new Client({ infoHash: fixtures.alice.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) @@ -40,7 +40,7 @@ function testFilterOption (t, serverType) { var client2 = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) @@ -88,7 +88,7 @@ test('ws: filter option blocks tracker from tracking torrent', function (t) { function testFilterCustomError (t, serverType) { t.plan(8) - var opts = { serverType: serverType } // this is test-suite-only option + var opts = { serverType } // this is test-suite-only option opts.filter = function (infoHash, params, cb) { process.nextTick(function () { if (infoHash === fixtures.alice.parsedTorrent.infoHash) { @@ -103,7 +103,7 @@ function testFilterCustomError (t, serverType) { var client1 = new Client({ infoHash: fixtures.alice.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) @@ -119,7 +119,7 @@ function testFilterCustomError (t, serverType) { var client2 = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) diff --git a/test/request-handler.js b/test/request-handler.js index d825a31e..a9e1fa37 100644 --- a/test/request-handler.js +++ b/test/request-handler.js @@ -9,7 +9,7 @@ var peerId = Buffer.from('01234567890123456789') function testRequestHandler (t, serverType) { t.plan(5) - var opts = { serverType: serverType } // this is test-suite-only option + var opts = { serverType } // this is test-suite-only option class Swarm extends Server.Swarm { announce (params, cb) { @@ -33,7 +33,7 @@ function testRequestHandler (t, serverType) { var client1 = new Client({ infoHash: fixtures.alice.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) diff --git a/test/scrape.js b/test/scrape.js index b372ec2d..08bf9b79 100644 --- a/test/scrape.js +++ b/test/scrape.js @@ -14,7 +14,7 @@ function testSingle (t, serverType) { var client = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881, wrtc: {} }) @@ -199,7 +199,7 @@ test('server: all info_hash scrape (manual http request)', function (t) { var client = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881 }) client.on('error', function (err) { t.error(err) }) diff --git a/test/server.js b/test/server.js index ae3d956a..98576a0c 100644 --- a/test/server.js +++ b/test/server.js @@ -19,7 +19,7 @@ function serverTest (t, serverType, serverFamily) { : '127.0.0.1' var opts = { - serverType: serverType + serverType } common.createServer(t, opts, function (server) { @@ -29,11 +29,11 @@ function serverTest (t, serverType, serverFamily) { var announceUrl = serverType + '://' + hostname + ':' + port + '/announce' var client1 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], - peerId: peerId, + peerId, port: 6881, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client1) @@ -89,11 +89,11 @@ function serverTest (t, serverType, serverFamily) { t.equal(typeof data.downloaded, 'number') var client2 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], peerId: peerId2, port: 6882, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client2) @@ -109,11 +109,11 @@ function serverTest (t, serverType, serverFamily) { t.equal(data.incomplete, 1) var client3 = new Client({ - infoHash: infoHash, + infoHash, announce: [announceUrl], peerId: peerId3, port: 6880, - wrtc: wrtc + wrtc }) if (serverType === 'ws') common.mockWebsocketTracker(client3) diff --git a/test/stats.js b/test/stats.js index 5b14f81b..0cedc485 100644 --- a/test/stats.js +++ b/test/stats.js @@ -120,7 +120,7 @@ test('server: get leecher stats.json', function (t) { var client = new Client({ infoHash: fixtures.leaves.parsedTorrent.infoHash, announce: announceUrl, - peerId: peerId, + peerId, port: 6881 }) client.on('error', function (err) { t.error(err) })