diff --git a/.github/workflows/coveralls.yml b/.github/workflows/main.yml similarity index 90% rename from .github/workflows/coveralls.yml rename to .github/workflows/main.yml index b52a4e7..0d7cc50 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Tests +name: Build & Test main on: push: @@ -15,7 +15,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: "18" + node-version: "20" - name: Install dependencies run: npm install diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..8941e11 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,23 @@ +name: Build & Test PR + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm run test:coverage diff --git a/README.md b/README.md index 7dfd49e..5ec36f4 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,30 @@ -[![Build Status](https://travis-ci.org/Novage/wt-tracker.svg?branch=master)](https://travis-ci.org/Novage/wt-tracker) [![Coverage Status](https://coveralls.io/repos/github/Novage/wt-tracker/badge.svg?branch=master)](https://coveralls.io/github/Novage/wt-tracker?branch=master) + # wt-tracker + High-performance WebTorrent tracker. WebTorrent tracker is a required component of [WebTorrent](https://github.com/webtorrent/webtorrent) and [P2P Media Loader](https://github.com/Novage/p2p-media-loader) (peer-to-peer networks for web browsers) to do [WebRTC](https://en.wikipedia.org/wiki/WebRTC) signaling - exchanging connection data (i.e. [SDP](https://en.wikipedia.org/wiki/Session_Description_Protocol)) between peers - joining them into swarms. ## Features -* handles more than 40k WebSocket Secure (HTTPS) peers on a VPS with only 2 GiB memory and 1 virtual CPU thanks to [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) I/O backend and perfomance optimizations in the code -* handles ws:// (HTTP) and wss:// (HTTPS) connections simultaneously -* IPv4 and IPv6 support -* robust and well-tested: CI, unit tests, static code analyzis, 100% TypeScript -* supports tracker "scrape" extension -* statistics under /stats.json URL +- handles more than 40k WebSocket Secure (HTTPS) peers on a VPS with only 2 GiB memory and 1 virtual CPU thanks to [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) I/O backend and perfomance optimizations in the code +- handles ws:// (HTTP) and wss:// (HTTPS) connections simultaneously +- IPv4 and IPv6 support +- robust and well-tested: CI, unit tests, static code analyzis, 100% TypeScript +- supports tracker "scrape" extension +- statistics under /stats.json URL ## Related projects -* [P2P Media Loader](https://github.com/Novage/p2p-media-loader) - an open-source engine for P2P streaming of live and on demand video directly in a web browser HTML page -* [Novage, LLC](https://novage.com.ua/) - P2P development, support & consulting -* [WebTorrent](https://github.com/webtorrent/webtorrent) - streaming torrent client for the web https://webtorrent.io -* [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) - the Node.js bindings to µWebSockets, one of the most efficient web servers available +- [P2P Media Loader](https://github.com/Novage/p2p-media-loader) - an open-source engine for P2P streaming of live and on demand video directly in a web browser HTML page +- [Novage, LLC](https://novage.com.ua/) - P2P development, support & consulting +- [WebTorrent](https://github.com/webtorrent/webtorrent) - streaming torrent client for the web https://webtorrent.io +- [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js) - the Node.js bindings to µWebSockets, one of the most efficient web servers available ## Build instructions -Node.js 10+ is required. +Node.js 16+ is required. ```sh npm install @@ -52,15 +53,15 @@ npm start [config.json] See [config.json](sample/config.json) -|Name|Type|Description| -|----|----|-----------| -|servers.websockets.path|string|URL pattern for the WebSockets endpoint| -|servers.websockets.maxPayloadLength|number|The maximum length of received message| -|servers.websockets.midleTimeout|number|The maximum amount of seconds that may pass without sending or getting a message. Being idle for more than this, and the connection is severed.| -|servers.websockets.compression|0,1,2|0 = no compression, 1 = shared compressor, 2 = dedicated compressor (see [details](https://github.com/uNetworking/uWebSockets/blob/master/misc/READMORE.md#settings))| -|servers.websockets.maxConnections|number|The maximum number of WebSocket connections. 0 = no limit.| -|tracker.maxOffers|number|The maximum number of client's WebRTC SDP offers that are processed| -|tracker.announceInterval|number|Desired announce interval in seconds required from the clients| +| Name | Type | Description | +| ----------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| servers.websockets.path | string | URL pattern for the WebSockets endpoint | +| servers.websockets.maxPayloadLength | number | The maximum length of received message | +| servers.websockets.midleTimeout | number | The maximum amount of seconds that may pass without sending or getting a message. Being idle for more than this, and the connection is severed. | +| servers.websockets.compression | 0,1,2 | 0 = no compression, 1 = shared compressor, 2 = dedicated compressor (see [details](https://github.com/uNetworking/uWebSockets/blob/master/misc/READMORE.md#settings)) | +| servers.websockets.maxConnections | number | The maximum number of WebSocket connections. 0 = no limit. | +| tracker.maxOffers | number | The maximum number of client's WebRTC SDP offers that are processed | +| tracker.announceInterval | number | Desired announce interval in seconds required from the clients | ## Index HTML page diff --git a/package-lock.json b/package-lock.json index a228f9b..88d13c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@types/chai": "^4.3.11", "@types/debug": "^4.1.12", "@types/mocha": "^10.0.6", - "@types/node": "^20.11.17", + "@types/node": "^20.11.18", "@types/ws": "^8.5.10", "@typescript-eslint/eslint-plugin": "^7.0.1", "@typescript-eslint/parser": "^7.0.1", @@ -33,7 +33,7 @@ "ws": "^8.16.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=16.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -988,9 +988,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.11.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", - "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", + "version": "20.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.18.tgz", + "integrity": "sha512-ABT5VWnnYneSBcNWYSCuR05M826RoMyMSGiFivXGx6ZUIsXb9vn4643IEwkg2zbEOSgAiSogtapN2fgc4mAPlw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3527,9 +3527,9 @@ } }, "node_modules/vite": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.2.tgz", - "integrity": "sha512-uwiFebQbTWRIGbCaTEBVAfKqgqKNKMJ2uPXsXeLIZxM8MVMjoS3j0cG8NrPxdDIadaWnPSjrkLWffLSC+uiP3Q==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.3.tgz", + "integrity": "sha512-UfmUD36DKkqhi/F75RrxvPpry+9+tTkrXfMNZD+SboZqBCMsxKtO52XeGzzuh7ioz+Eo/SYDBbdb0Z7vgcDJew==", "dev": true, "dependencies": { "esbuild": "^0.19.3", diff --git a/package.json b/package.json index d7c3cb3..9c4458b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "types": "dist/index.d.ts", "type": "module", "engines": { - "node": ">=10.0.0" + "node": ">=16.0.0" }, "bin": { "wt-tracker": "./bin/wt-tracker" @@ -49,7 +49,7 @@ "@types/chai": "^4.3.11", "@types/debug": "^4.1.12", "@types/mocha": "^10.0.6", - "@types/node": "^20.11.17", + "@types/node": "^20.11.18", "@types/ws": "^8.5.10", "@typescript-eslint/eslint-plugin": "^7.0.1", "@typescript-eslint/parser": "^7.0.1", diff --git a/travis.yml b/travis.yml deleted file mode 100644 index 8d972a6..0000000 --- a/travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -node_js: - - 20 - - 18 -install: - - npm install -script: - - npm run build - - npm test -after_success: - - npm run test:coveralls