# wt-tracker

> High performance WebTorrent tracker

Latest version **0.0.1** (published 2022-10-30) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install wt-tracker
pnpm add wt-tracker
yarn add wt-tracker
bun add wt-tracker
```

Provides the command `wt-tracker`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-10-30 |
| First published | 2022-10-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0.0 |
| Dependencies | 2 |
| Unpacked size | 85.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 279 |
| Author | Novage |
| Maintainers | parweb |
| Keywords | p2p, peer-to-peer, webrtc, torrent, bittorrent, bittorrent-tracker, webtorrent, tracker, websockets |

## Links

- npm: https://www.npmjs.com/package/wt-tracker
- Repository: https://github.com/Novage/wt-tracker
- Issues: https://github.com/Novage/wt-tracker/issues
- npm.io page: https://npm.io/package/wt-tracker

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [uWebSockets.js](https://npm.io/package/uWebSockets.js.md) github:uNetworking/uWebSockets.js#v17.4.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2022-10-30

## README

[![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

## 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

## Build instructions

Node.js 10+ is required.

```sh
npm install
npm run build
```

## Run instructions

```sh
./bin/wt-tracker [config.json]
```

or

```sh
node dist/run-uws-tracker.js [config.json]
```

or

```sh
npm start [config.json]
```

## Configuration

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|

## Index HTML page

You can specify a content of the index page by creating `index.html` file in the working directory.

---
_Source: https://npm.io/package/wt-tracker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
