Skip to content

Commit

Permalink
Merge pull request #64 from Novage/feat/readme
Browse files Browse the repository at this point in the history
Readme file
  • Loading branch information
mrlika authored Feb 15, 2024
2 parents 269eb6a + 7cf412d commit 59956f6
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Build & Test main

on:
push:
Expand All @@ -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
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -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
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
11 changes: 0 additions & 11 deletions travis.yml

This file was deleted.

0 comments on commit 59956f6

Please sign in to comment.