From f2f4990501f918bf6ab0106a03f9c7a1d0d1bbc8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 7 Nov 2024 19:00:51 +0100 Subject: [PATCH 01/10] Add subpath import for client and server (#535) --- README.md | 3 +++ package.json | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f0d99c1..db0eba16 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ To start a BitTorrent tracker server to track swarms of peers: ```js import { Server } from 'bittorrent-tracker' +// Or import Server from 'bittorrent-tracker/server' const server = new Server({ udp: true, // enable udp server? [default=true] @@ -267,6 +268,8 @@ Scraping multiple torrent info is possible with a static `Client.scrape` method: ```js import Client from 'bittorrent-tracker' +// Or import Client from 'bittorrent-tracker/client' + Client.scrape({ announce: announceUrl, infoHash: [ infoHash1, infoHash2 ]}, function (err, results) { results[infoHash1].announce results[infoHash1].infoHash diff --git a/package.json b/package.json index 982272d3..8984180a 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,15 @@ "node": ">=16.0.0" }, "exports": { - "import": "./index.js" + ".": { + "import": "./index.js" + }, + "./client": { + "import": "./client.js" + }, + "./server": { + "import": "./server.js" + } }, "keywords": [ "bittorrent", From e45516d73a1ca546f7eeaf75d93e9b32ca3ca00f Mon Sep 17 00:00:00 2001 From: uriva Date: Fri, 29 Nov 2024 11:53:40 +0200 Subject: [PATCH 02/10] Bugfix - when using AbortController, errors on resulting stream must be caught (#539) * use-native-fetch * Bugfix: `res.body` should handle errors according to https://github.com/nodejs/undici/issues/3353#issuecomment-2184635954 * Revert "use-native-fetch" This reverts commit d65460319ea116fb28defc677af878cec42e8d43. * fix-quotes * some-build-targets-return-different-output --- lib/client/http-tracker.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/client/http-tracker.js b/lib/client/http-tracker.js index a31fb604..678f7a26 100644 --- a/lib/client/http-tracker.js +++ b/lib/client/http-tracker.js @@ -150,6 +150,7 @@ class HTTPTracker extends Tracker { 'user-agent': this.client._userAgent || '' } }) + if (res.body.on) res.body.on('error', cb) } catch (err) { if (err) return cb(err) } From 7c963a6f5e7664d7d12d44ca5bac61b910e7bd8f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 28 Dec 2024 12:45:50 +0000 Subject: [PATCH 03/10] chore(deps): update actions/cache action to v4 (#543) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 037e5acf..61c6902c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: with: node-version: 18 - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }} From e7de90c0cbcfb41c9c53c5caf69cc37c6d3ef1e8 Mon Sep 17 00:00:00 2001 From: Brad Marsden Date: Sat, 28 Dec 2024 13:16:20 +0000 Subject: [PATCH 04/10] feat: release #539 and #535 (#544) From 980919508807d76c52a7236ea90c94e25f9d5d8b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 28 Dec 2024 13:19:22 +0000 Subject: [PATCH 05/10] chore(release): 11.2.0 # [11.2.0](https://github.com/webtorrent/bittorrent-tracker/compare/v11.1.2...v11.2.0) (2024-12-28) ### Features * release [#539](https://github.com/webtorrent/bittorrent-tracker/issues/539) and [#535](https://github.com/webtorrent/bittorrent-tracker/issues/535) ([#544](https://github.com/webtorrent/bittorrent-tracker/issues/544)) ([e7de90c](https://github.com/webtorrent/bittorrent-tracker/commit/e7de90c0cbcfb41c9c53c5caf69cc37c6d3ef1e8)) --- AUTHORS.md | 2 ++ CHANGELOG.md | 7 +++++++ package.json | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 86740739..50d9f2f4 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -67,5 +67,7 @@ - Arsène Fougerouse (arsene582@gmail.com) - Brad Marsden (silentbot1@gmail.com) - krazak (krazak@vt.edu) +- Chocobozzz (chocobozzz@cpy.re) +- uriva (uriva@users.noreply.github.com) #### Generated by tools/update-authors.sh. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8992459f..84c04d73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [11.2.0](https://github.com/webtorrent/bittorrent-tracker/compare/v11.1.2...v11.2.0) (2024-12-28) + + +### Features + +* release [#539](https://github.com/webtorrent/bittorrent-tracker/issues/539) and [#535](https://github.com/webtorrent/bittorrent-tracker/issues/535) ([#544](https://github.com/webtorrent/bittorrent-tracker/issues/544)) ([e7de90c](https://github.com/webtorrent/bittorrent-tracker/commit/e7de90c0cbcfb41c9c53c5caf69cc37c6d3ef1e8)) + ## [11.1.2](https://github.com/webtorrent/bittorrent-tracker/compare/v11.1.1...v11.1.2) (2024-08-13) diff --git a/package.json b/package.json index 8984180a..4cb56fcd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bittorrent-tracker", "description": "Simple, robust, BitTorrent tracker (client & server) implementation", - "version": "11.1.2", + "version": "11.2.0", "author": { "name": "WebTorrent LLC", "email": "feross@webtorrent.io", From 934dc1bafc440146e3522eb39402cca222a102cb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 16:46:56 +0000 Subject: [PATCH 06/10] chore(deps): update dependency magnet-uri to v7.0.7 (#545) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4cb56fcd..071d7730 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "devDependencies": { "@mapbox/node-pre-gyp": "1.0.11", "@webtorrent/semantic-release-config": "1.0.10", - "magnet-uri": "7.0.5", + "magnet-uri": "7.0.7", "semantic-release": "21.1.2", "standard": "*", "tape": "5.9.0", From 3cd77f3e6f5b52f5d58adaf004b333cd2061a4da Mon Sep 17 00:00:00 2001 From: Cas_ <6506529+ThaUnknown@users.noreply.github.com> Date: Sun, 19 Jan 2025 23:33:16 +0100 Subject: [PATCH 07/10] fix: http announce no left (#548) * fix: http announce no left * fix: proper left check --- lib/client/http-tracker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/client/http-tracker.js b/lib/client/http-tracker.js index 678f7a26..43464e8e 100644 --- a/lib/client/http-tracker.js +++ b/lib/client/http-tracker.js @@ -55,6 +55,8 @@ class HTTPTracker extends Tracker { peer_id: this.client._peerIdBinary, port: this.client._port }) + + if (params.left !== 0 && !params.left) params.left = 16384 if (this._trackerId) params.trackerid = this._trackerId this._request(this.announceUrl, params, (err, data) => { From b4557a7f65635f6ae8100828d51f257ed1a6d0b6 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 19 Jan 2025 22:36:07 +0000 Subject: [PATCH 08/10] chore(release): 11.2.1 ## [11.2.1](https://github.com/webtorrent/bittorrent-tracker/compare/v11.2.0...v11.2.1) (2025-01-19) ### Bug Fixes * http announce no left ([#548](https://github.com/webtorrent/bittorrent-tracker/issues/548)) ([3cd77f3](https://github.com/webtorrent/bittorrent-tracker/commit/3cd77f3e6f5b52f5d58adaf004b333cd2061a4da)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84c04d73..7f21349d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [11.2.1](https://github.com/webtorrent/bittorrent-tracker/compare/v11.2.0...v11.2.1) (2025-01-19) + + +### Bug Fixes + +* http announce no left ([#548](https://github.com/webtorrent/bittorrent-tracker/issues/548)) ([3cd77f3](https://github.com/webtorrent/bittorrent-tracker/commit/3cd77f3e6f5b52f5d58adaf004b333cd2061a4da)) + # [11.2.0](https://github.com/webtorrent/bittorrent-tracker/compare/v11.1.2...v11.2.0) (2024-12-28) diff --git a/package.json b/package.json index 071d7730..1593e197 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bittorrent-tracker", "description": "Simple, robust, BitTorrent tracker (client & server) implementation", - "version": "11.2.0", + "version": "11.2.1", "author": { "name": "WebTorrent LLC", "email": "feross@webtorrent.io", From 15715518decfed77d7888ba21d6ab592fa91cc85 Mon Sep 17 00:00:00 2001 From: Subin Siby Date: Sat, 6 Sep 2025 17:55:35 +0530 Subject: [PATCH 09/10] fix: export WebSocketTracker (#558) --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 1593e197..f0166623 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,9 @@ }, "./server": { "import": "./server.js" + }, + "./websocket-tracker": { + "import": "./lib/client/websocket-tracker.js" } }, "keywords": [ From 295c69ab61719a61952a342b04390abfa9e9ac08 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 6 Sep 2025 12:28:37 +0000 Subject: [PATCH 10/10] chore(release): 11.2.2 ## [11.2.2](https://github.com/webtorrent/bittorrent-tracker/compare/v11.2.1...v11.2.2) (2025-09-06) ### Bug Fixes * export WebSocketTracker ([#558](https://github.com/webtorrent/bittorrent-tracker/issues/558)) ([1571551](https://github.com/webtorrent/bittorrent-tracker/commit/15715518decfed77d7888ba21d6ab592fa91cc85)) --- AUTHORS.md | 1 + CHANGELOG.md | 7 +++++++ package.json | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 50d9f2f4..3b930ae6 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -69,5 +69,6 @@ - krazak (krazak@vt.edu) - Chocobozzz (chocobozzz@cpy.re) - uriva (uriva@users.noreply.github.com) +- Subin Siby (mail@subinsb.com) #### Generated by tools/update-authors.sh. diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f21349d..6b00b4dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [11.2.2](https://github.com/webtorrent/bittorrent-tracker/compare/v11.2.1...v11.2.2) (2025-09-06) + + +### Bug Fixes + +* export WebSocketTracker ([#558](https://github.com/webtorrent/bittorrent-tracker/issues/558)) ([1571551](https://github.com/webtorrent/bittorrent-tracker/commit/15715518decfed77d7888ba21d6ab592fa91cc85)) + ## [11.2.1](https://github.com/webtorrent/bittorrent-tracker/compare/v11.2.0...v11.2.1) (2025-01-19) diff --git a/package.json b/package.json index f0166623..ca9cebd6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bittorrent-tracker", "description": "Simple, robust, BitTorrent tracker (client & server) implementation", - "version": "11.2.1", + "version": "11.2.2", "author": { "name": "WebTorrent LLC", "email": "feross@webtorrent.io",