Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

webtorrent

webtorrent40.8kMIT2.6.3TypeScript support: definitely-typed

Streaming torrent client

bittorrent, bittorrent client, download, mad science, p2p, peer-to-peer, peers, streaming, swarm, torrent, web torrent, webrtc, webrtc data, webtorrent

readme


WebTorrent
WebTorrent

The streaming torrent client. For node.js and the web.

discord ci npm version npm downloads Standard - JavaScript Style Guide

Sponsored by    Socket - JavaScript open source supply chain security    Wormhole

WebTorrent is a streaming torrent client for node.js and the browser. YEP, THAT'S RIGHT. THE BROWSER. It's written completely in JavaScript – the language of the web – so the same code works in both runtimes.

In node.js, this module is a simple torrent client, using TCP and UDP to talk to other torrent clients.

In the browser, WebTorrent uses WebRTC (data channels) for peer-to-peer transport. It can be used without browser plugins, extensions, or installations. It's Just JavaScript™. Note: WebTorrent does not support UDP/TCP peers in browser.

Simply include the webtorrent.min.js script on your page to start fetching files over WebRTC using the BitTorrent protocol, or import WebTorrent from 'webtorrent' with browserify or webpack. See demo apps and code examples below.

jsdelivr download count

To make BitTorrent work over WebRTC (which is the only P2P transport that works on the web) we made some protocol changes. Therefore, a browser-based WebTorrent client or "web peer" can only connect to other clients that support WebTorrent/WebRTC.

To seed files to web peers, use a client that supports WebTorrent, e.g. WebTorrent Desktop, a desktop client with a familiar UI that can connect to web peers, webtorrent-hybrid, a command line program, or Instant.io, a website. Established torrent clients like Vuze have already added WebTorrent support so they can connect to both normal and web peers. We hope other clients will follow.

Network

Features

  • Torrent client for node.js & the browser (same npm package!)
  • Insanely fast
  • Download multiple torrents simultaneously, efficiently
  • Pure Javascript (no native dependencies)
  • Exposes files as streams
    • Fetches pieces from the network on-demand so seeking is supported (even before torrent is finished)
    • Seamlessly switches between sequential and rarest-first piece selection strategy
  • Supports advanced torrent client features
  • Comprehensive test suite (runs completely offline, so it's reliable and fast)
  • Check all the supported BEPs here

Browser/WebRTC environment features

  • WebRTC data channels for lightweight peer-to-peer communication with no plugins
  • No silos. WebTorrent is a P2P network for the entire web. WebTorrent clients running on one domain can connect to clients on any other domain.
  • Stream video torrents into a <video> tag (webm, mkv, mp4, ogv, mov, etc (AV1, H264, HEVC*, VP8, VP9, AAC, FLAC, MP3, OPUS, Vorbis, etc))
  • Supports Chrome, Firefox, Opera and Safari.

Install

To install WebTorrent for use in node or the browser with import WebTorrent from 'webtorrent', run:

npm install webtorrent

To install a webtorrent command line program, run:

npm install webtorrent-cli -g

To install a WebTorrent desktop application for Mac, Windows, or Linux, see WebTorrent Desktop.

Ways to help

Who is using WebTorrent today?

Lots of folks!

WebTorrent API Documentation

Read the full API Documentation.

Usage

WebTorrent is the first BitTorrent client that works in the browser, using open web standards (no plugins, just HTML5 and WebRTC)! It's easy to get started!

In the browser

Downloading a file is simple:
import WebTorrent from 'webtorrent'

const client = new WebTorrent()
const magnetURI = '...'

client.add(magnetURI, torrent => {
  // Got torrent metadata!
  console.log('Client is downloading:', torrent.infoHash)

  for (const file of torrent.files) {
    document.body.append(file.name)
  }
})
Seeding a file is simple, too:
import dragDrop from 'drag-drop'
import WebTorrent from 'webtorrent'

const client = new WebTorrent()

// When user drops files on the browser, create a new torrent and start seeding it!
dragDrop('body', files => {
  client.seed(files, torrent => {
    console.log('Client is seeding:', torrent.infoHash)
  })
})

There are more examples in docs/get-started.md.

Browserify

WebTorrent works great with browserify, an npm package that lets you use node-style require() to organize your browser code and load modules installed by npm (as seen in the previous examples).

Webpack

WebTorrent also works with webpack, another module bundler. However, webpack requires extra configuration which you can find in the webpack bundle config used by webtorrent.

Or, you can just use the pre-built version via import WebTorrent from 'webtorrent/dist/webtorrent.min.js' and skip the webpack configuration.

Script tag

WebTorrent is also available as a standalone script (webtorrent.min.js) which exposes WebTorrent on the window object, so it can be used with just a script tag:

<script type='module'>
  import WebTorrent from 'webtorrent.min.js'
</script>

The WebTorrent script is also hosted on fast, reliable CDN infrastructure (Cloudflare and MaxCDN) for easy inclusion on your site:

<script type='module'>
  import WebTorrent from 'https://esm.sh/webtorrent'
</script>
Chrome App

If you want to use WebTorrent in a Chrome App, you can include the following script:

<script type='module'>
  import WebTorrent from 'webtorrent.chromeapp.js'
</script>

Be sure to enable the chrome.sockets.udp and chrome.sockets.tcp permissions!

In Node.js

WebTorrent also works in node.js, using the same npm package! It's mad science!

NOTE: To connect to "web peers" (browsers) in addition to normal BitTorrent peers, use webtorrent-hybrid which includes WebRTC support for node.

As a command line app

WebTorrent is also available as a command line app. Here's how to use it:

$ npm install webtorrent-cli -g
$ webtorrent --help

To download a torrent:

$ webtorrent magnet_uri

To stream a torrent to a device like AirPlay or Chromecast, just pass a flag:

$ webtorrent magnet_uri --airplay

There are many supported streaming options:

--airplay               Apple TV
--chromecast            Chromecast
--mplayer               MPlayer
--mpv                   MPV
--omx [jack]            omx [default: hdmi]
--vlc                   VLC
--xbmc                  XBMC
--stdout                standard out [implies --quiet]

In addition to magnet uris, WebTorrent supports many ways to specify a torrent.

Talks about WebTorrent

Modules

Most of the active development is happening inside of small npm packages which are used by WebTorrent.

The Node Way™

"When applications are done well, they are just the really application-specific, brackish residue that can't be so easily abstracted away. All the nice, reusable components sublimate away onto github and npm where everybody can collaborate to advance the commons." — substack from "how I write modules"

node.js is shiny

Modules

These are the main modules that make up WebTorrent:

module tests version description
webtorrent torrent client (this module)
bittorrent-dht distributed hash table client
bittorrent-peerid identify client name/version
bittorrent-protocol bittorrent protocol stream
bittorrent-tracker bittorrent tracker server/client
bittorrent-lsd bittorrent local service discovery
create-torrent create .torrent files
magnet-uri parse magnet uris
parse-torrent parse torrent identifiers
torrent-discovery find peers via dht, tracker, and lsd
ut_metadata metadata for magnet uris (protocol extension)
ut_pex peer discovery (protocol extension)

Enable debug logs

In node, enable debug logs by setting the DEBUG environment variable to the name of the module you want to debug (e.g. bittorrent-protocol, or * to print all logs).

DEBUG=* webtorrent

In the browser, enable debug logs by running this in the developer console:

localStorage.setItem('debug', '*')

Disable by running this:

localStorage.removeItem('debug')

License

MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.

changelog

2.6.3 (2025-04-18)

Bug Fixes

  • deps: update dependency torrent-discovery to ^11.0.16 (#2943) (6c0154e)

2.6.2 (2025-04-18)

Bug Fixes

2.6.1 (2025-04-18)

Bug Fixes

  • deps: update dependency @silentbot1/nat-api to ^0.4.8 (#2941) (134362e)

2.6.0 (2025-04-04)

Features

  • add an option to store the bitfield in the file system (#2878) (e29a474)

2.5.19 (2025-02-05)

Bug Fixes

  • deps: update dependency streamx to v2.22.0 (#2921) (f06ac81)

2.5.18 (2025-02-02)

2.5.17 (2025-01-30)

Bug Fixes

  • deps: update dependency torrent-piece to ^3.0.1 (#2920) (86d7980)

2.5.16 (2025-01-29)

Bug Fixes

  • deps: update dependency streamx to v2.21.1 (#2898) (7727845)

2.5.15 (2025-01-29)

Bug Fixes

  • bad done and select behavior and documentation (#2916) (8237d5f)

2.5.14 (2025-01-21)

Bug Fixes

2.5.13 (2025-01-20)

Bug Fixes

2.5.12 (2025-01-04)

Bug Fixes

2.5.11 (2024-12-28)

Bug Fixes

  • deps: update dependency torrent-discovery to ^11.0.14 (#2908) (85e1d8a)

2.5.10 (2024-12-07)

Bug Fixes

  • deps: update dependency torrent-discovery to ^11.0.13 (#2901) (03f7021)

2.5.9 (2024-12-07)

Bug Fixes

2.5.8 (2024-12-07)

Bug Fixes

2.5.7 (2024-11-23)

Bug Fixes

  • deps: update dependency streamx to v2.20.2 (#2888) (4b00a0e)

2.5.6 (2024-11-17)

Bug Fixes

2.5.5 (2024-11-06)

Bug Fixes

  • deps: update dependency streamx to v2.20.1 (#2855) (6618cee)

2.5.4 (2024-11-06)

Bug Fixes

2.5.3 (2024-11-05)

Bug Fixes

  • deps: update webtorrent (c5eed32)

2.5.2 (2024-11-05)

Bug Fixes

  • parse host even if this.client.blocked is false, to allow line 868 to pass correctly and default to utp. (#2805) (beef270)

2.5.1 (2024-09-07)

Bug Fixes

  • deps: update dependency debug to ^4.3.7 (69c1441)

2.5.0 (2024-08-04)

Features

2.4.15 (2024-08-03)

Bug Fixes

2.4.14 (2024-07-28)

Bug Fixes

  • deps: update dependency debug to ^4.3.6 (c6dde2c)

2.4.13 (2024-07-28)

Bug Fixes

  • deps: update webtorrent (9eb656f)

2.4.12 (2024-07-17)

Bug Fixes

  • deps: update dependency @thaunknown/simple-peer to ^10.0.10 (09d7ea0)

2.4.11 (2024-06-29)

Bug Fixes

2.4.10 (2024-06-29)

Bug Fixes

2.4.9 (2024-06-29)

Bug Fixes

  • deps: update dependency @thaunknown/simple-peer to ^10.0.9 (fc54e8e)

2.4.8 (2024-06-29)

Bug Fixes

2.4.7 (2024-06-29)

Bug Fixes

  • deps: update dependency parse-torrent to ^11.0.17 (72f4abc)

2.4.6 (2024-06-29)

Bug Fixes

2.4.5 (2024-06-29)

Bug Fixes

  • deps: update dependency bittorrent-protocol to ^4.1.13 (d596da6)

2.4.4 (2024-06-28)

Bug Fixes

  • deps: update dependency streamx to ^2.18.0 (#2798) (20e18b3)

2.4.3 (2024-06-28)

Bug Fixes

  • deps: update dependency @thaunknown/simple-peer to ^10.0.8 (27e34e5)
  • deps: update dependency hybrid-chunk-store to ^1.2.6 (#2818) (478c691)

2.4.2 (2024-06-22)

Bug Fixes

  • allow client level default trackers to be set (#2815) (a0e056d)

2.4.1 (2024-06-13)

2.4.0 (2024-06-06)

Features

  • add opts.seedOutgoingConnections to allow controlling outbound connections for seeding. (#2803) (d40616f)

2.3.6 (2024-06-02)

Bug Fixes

  • deps: update webtorrent to ^11.0.6 (63061c6)

2.3.5 (2024-06-01)

Bug Fixes

  • deps: update dependency torrent-discovery to ^11.0.5 (4742c01)

2.3.4 (2024-06-01)

Bug Fixes

  • deps: update webtorrent (6ff995f)

2.3.3 (2024-06-01)

Bug Fixes

  • deps: update dependency debug to ^4.3.5 (4a47201)

2.3.2 (2024-05-25)

Bug Fixes

  • deps: update dependency bitfield to ^4.2.0 (#2730) (867e4f2)

2.3.1 (2024-05-23)

Bug Fixes

  • deps: update dependency uint8-util to ^2.2.5 (#2784) (3c3993f)

2.3.0 (2024-05-23)

Features

2.2.2 (2024-05-23)

Bug Fixes

  • deps: update dependency torrent-discovery to ^11.0.4 (9841d3d)

2.2.1 (2024-03-26)

Bug Fixes

  • deps: update dependency hybrid-chunk-store to ^1.2.4 (#2764) (9ce6188)

2.2.0 (2024-03-26)

Features

  • Refactor selections with non-overlapping data structure (#2757) (467f30c)

2.1.37 (2024-03-04)

Bug Fixes

  • deps: update dependency streamx to ^2.16.1 (#2752) (33e87e2)

2.1.36 (2024-02-09)

Bug Fixes

  • deps: update dependency create-torrent to ^6.0.17 (54f6add)

2.1.35 (2024-02-04)

Bug Fixes

  • deps: update dependency streamx to ^2.15.7 (#2748) (13b135f)

2.1.34 (2024-01-16)

Bug Fixes

  • deps: update webtorrent (0585322)

2.1.33 (2024-01-12)

Bug Fixes

2.1.32 (2023-12-12)

Bug Fixes

  • deps: update dependency create-torrent to ^6.0.16 (97c0af1)

2.1.31 (2023-12-11)

Bug Fixes

  • deps: update dependency streamx to ^2.15.6 (#2715) (3f4a80f)

2.1.30 (2023-11-30)

Bug Fixes

  • deps: update dependency streamx to ^2.15.5 (#2695) (262e1e5)

2.1.29 (2023-11-12)

Bug Fixes

2.1.28 (2023-11-09)

Bug Fixes

  • deps: update dependency torrent-discovery to v11 (#2702) (62ff1bf)

2.1.27 (2023-10-03)

Bug Fixes

  • deps: update dependency uint8-util to ^2.2.4 (#2653) (26ab5d3)

2.1.26 (2023-10-02)

Bug Fixes

  • incorrect File.stream() object this reference (#2672) (8577a47)

2.1.25 (2023-08-11)

Bug Fixes

  • deps: update webtorrent (1639c0e)

2.1.24 (2023-08-11)

Bug Fixes

  • deps: update dependency bittorrent-protocol to ^4.1.11 (701280f)

2.1.23 (2023-08-10)

Bug Fixes

  • deps: update dependency create-torrent to ^6.0.14 (d7e81ea)

2.1.22 (2023-08-10)

Bug Fixes

  • deps: update webtorrent (d447f8c)

2.1.21 (2023-08-10)

Bug Fixes

  • deps: update dependency bittorrent-protocol to ^4.1.10 (0c60f65)

2.1.20 (2023-08-10)

Bug Fixes

  • deps: update dependency ut_metadata to ^4.0.3 (c62044a)

2.1.19 (2023-08-10)

Bug Fixes

  • deps: update webtorrent (4a60108)

2.1.18 (2023-08-09)

Bug Fixes

  • deps: update dependency streamx to ^2.15.1 (#2593) (260fca8)

2.1.17 (2023-08-06)

Bug Fixes

  • deps: update webtorrent (9ad7e9b)

2.1.16 (2023-07-30)

Bug Fixes

  • deps: update dependency uint8-util to ^2.2.2 (#2633) (8478be4)

2.1.15 (2023-07-24)

Bug Fixes

  • deps: update webtorrent (f9b34d6)

2.1.14 (2023-07-23)

Bug Fixes

  • deps: update dependency torrent-piece to v3 (#2623) (7fb7afa)

2.1.13 (2023-07-19)

Bug Fixes

  • deps: update dependency @silentbot1/nat-api to ^0.4.7 (#2619) (a44286c)

2.1.12 (2023-07-05)

Bug Fixes

2.1.11 (2023-06-17)

Performance Improvements

2.1.10 (2023-06-17)

Bug Fixes

  • deps: update dependency hybrid-chunk-store to ^1.2.2 (#2595) (b04cc7a)

2.1.9 (2023-06-17)

Bug Fixes

2.1.8 (2023-06-16)

Performance Improvements

2.1.7 (2023-06-16)

Bug Fixes

2.1.6 (2023-06-16)

Performance Improvements

2.1.5 (2023-06-16)

Bug Fixes

  • deps: update dependency @thaunknown/simple-peer to ^9.12.1 (#2588) (9ea487b)

2.1.4 (2023-06-16)

Bug Fixes

  • deps: update dependency hybrid-chunk-store to ^1.2.1 (#2589) (f482419)

2.1.3 (2023-06-16)

Bug Fixes

  • deps: update dependency streamx to ^2.14.3 (#2583) (d68ea94)

2.1.2 (2023-06-16)

Bug Fixes

  • deps: update dependency fs-chunk-store to ^4.1.0 (c9103bf)

2.1.1 (2023-06-15)

Bug Fixes

  • Revert "fix: correctly destroy piped streams in server" (#2585) (e3c9269), closes #2565

2.1.0 (2023-06-13)

Features

2.0.37 (2023-06-08)

Bug Fixes

2.0.36 (2023-06-08)

Bug Fixes

  • deps: update dependency torrent-discovery to ^10.0.11 (9415322)

2.0.35 (2023-06-07)

Bug Fixes

  • deps: update dependency semantic-release to v21 (#2510) (e74b843)

2.0.34 (2023-06-05)

Bug Fixes

  • deps: update dependency torrent-discovery to ^10.0.10 (#2569) (31796f8)

2.0.33 (2023-06-05)

Bug Fixes

  • deps: update dependency streamx to ^2.14.0 (#2568) (29f412a)

2.0.32 (2023-06-05)

Bug Fixes

  • deps: update dependency streamx to ^2.13.3 (#2562) (11f86db)

2.0.31 (2023-06-05)

Bug Fixes

  • correctly destroy piped streams in server (#2565) (86eda0a)

2.0.30 (2023-06-05)

Bug Fixes

2.0.29 (2023-06-04)

Bug Fixes

2.0.28 (2023-06-03)

Bug Fixes

2.0.27 (2023-05-31)

Bug Fixes

  • deps: update dependency lt_donthave to v2 (#2555) (21e5007)

2.0.26 (2023-05-31)

Bug Fixes

  • deps: update dependency parse-torrent to ^11.0.12 (2766f6f)

2.0.25 (2023-05-30)

Bug Fixes

2.0.24 (2023-05-30)

Bug Fixes

  • deps: update dependency bittorrent-protocol to ^4.1.7 (#2551) (da87d38)

2.0.23 (2023-05-28)

Bug Fixes

2.0.22 (2023-05-27)

Bug Fixes

  • deps: update dependency torrent-discovery to ^10.0.9 (#2545) (e28a7ba)

2.0.21 (2023-05-27)

Performance Improvements

  • reduce the impact of request idle callback (#2542) (36a3e36)

2.0.20 (2023-05-27)

Bug Fixes

2.0.19 (2023-05-27)

Bug Fixes

  • deps: update dependency torrent-discovery to ^10.0.8 (714535b)

2.0.18 (2023-05-07)

Bug Fixes

  • deps: update dependency @webtorrent/semantic-release-config to v1.0.9 (#2528) (19d26f0)

2.0.17 (2023-05-04)

Bug Fixes

2.0.16 (2023-04-03)

Bug Fixes

  • deps: update webtorrent (7a7838c)

2.0.15 (2023-03-20)

Bug Fixes

  • Replace setting blob 'mimeType' property with 'type' (#2502) (869bdcd)

2.0.14 (2023-02-22)

Bug Fixes

  • deps: update dependency create-torrent to ^6.0.10 (d9e6784)

2.0.13 (2023-02-13)

Bug Fixes

  • deps: update dependency hybrid-chunk-store to ^1.2.0 (#2482) (792876b)

2.0.12 (2023-02-06)

Bug Fixes

  • deps: update dependency uint8-util to ^2.1.9 (#2480) (d9efb5d)

2.0.11 (2023-02-01)

Bug Fixes

  • deps: update dependency cross-fetch-ponyfill to ^1.0.3 (#2477) (970d937)

2.0.10 (2023-02-01)

Bug Fixes

  • deps: update dependency cross-fetch-ponyfill to ^1.0.3 (#2475) (63eeed1)

2.0.9 (2023-02-01)

Bug Fixes

2.0.8 (2023-01-31)

Bug Fixes

  • deps: update dependency uint8-util to ^2.1.7 (#2473) (9a6edff)

2.0.7 (2023-01-31)

Bug Fixes

  • deps: update dependency parse-torrent to ^11.0.5 (#2470) (9447cd6)

2.0.6 (2023-01-30)

Performance Improvements

2.0.5 (2023-01-30)

Bug Fixes

2.0.4 (2023-01-28)

Bug Fixes

  • make server index pages return links with absolute urls (#2455) (f2687e2), closes #2454

2.0.3 (2023-01-28)

Bug Fixes

  • deps: update dependency fs-chunk-store to ^4.0.1 (#2463) (bb7c640)

2.0.2 (2023-01-28)

Performance Improvements

2.0.1 (2023-01-25)

Bug Fixes

  • deps: update dependency hybrid-chunk-store to ^1.1.3 (2b7c435)

2.0.0 (2023-01-23)

Bug Fixes

Continuous Integration

  • Merge pull request #2260 from webtorrent/v2 (f8c545a), closes #2260
  • feat, perf: w3c-like File, file-iterator (#2414) (69d85a8), closes #2414

Features

  • esm (98353d9)
  • rescan of torrent should get all (in)valid events (#1903) (4745739)
  • sw-renderer tests (73aff7f)
  • unify HTTP server and SW renderer (7aeea17)
  • use storage (FSA+IDB) instead of memory in browser (00e1c9f)

Performance Improvements

BREAKING CHANGES

  • v2
  • ESM only, drop node 12 and ndoe 14
  • deprecate getBuffer

  • fix: reading when destroyed

1.9.7 (2023-01-12)

Bug Fixes

1.9.6 (2022-12-03)

Bug Fixes

1.9.5 (2022-12-03)

Bug Fixes

  • infinite error loop, connecting after destroy (79dbf69)

1.9.4 (2022-11-21)

Bug Fixes

1.9.3 (2022-11-18)

Bug Fixes

  • removePeer error after destroy (36a64a1)

1.9.2 (2022-11-11)

Bug Fixes

  • deps: update dependency create-torrent to ^5.0.9 (#2392) (d5139ed)

1.9.1 (2022-10-28)

Bug Fixes

  • deps: update dependency streamx to ^2.12.5 (#2366) (457a2d3)

1.9.0 (2022-10-28)

Bug Fixes

  • deps: update dependency fs-chunk-store to v3 (#2380) (9abd966)

Features

1.8.32 (2022-10-09)

Bug Fixes

  • deps: update dependency torrent-discovery to ^9.4.14 (8fadd4f)

1.8.31 (2022-10-08)

Bug Fixes

  • deps: update dependency bittorrent-dht to ^10.0.6 (#2384) (34089f8)

1.8.30 (2022-09-12)

Bug Fixes

  • return duplicate torrent on Webtorrent.add() (#2372) (05d27bf)

1.8.29 (2022-09-03)

Bug Fixes

  • deps: update dependency create-torrent to ^5.0.6 (03a0f50)

1.8.28 (2022-09-02)

Bug Fixes

  • deps: update dependency fast-blob-stream to ^1.1.1 (a441dea)
  • deps: update dependency join-async-iterator to ^1.1.1 (09b9958)

1.8.27 (2022-09-02)

Bug Fixes

1.8.26 (2022-07-04)

Bug Fixes

  • deps: update dependency create-torrent to ^5.0.4 (3728336)

1.8.25 (2022-07-03)

Bug Fixes

  • deps: update dependency create-torrent to ^5.0.3 (5009d10)

1.8.24 (2022-06-23)

Bug Fixes

1.8.23 (2022-06-23)

Bug Fixes

  • deps: update dependency torrent-discovery to ^9.4.13 (1e3373a)

1.8.22 (2022-05-24)

Bug Fixes

  • deps: update dependency bittorrent-dht to ^10.0.4 (327d723)

1.8.21 (2022-05-23)

Bug Fixes

  • deps: update dependency throughput to ^1.0.1 (#2321) (d53d95e)

1.8.20 (2022-05-14)

Bug Fixes

  • deps: update dependency bittorrent-dht to ^10.0.3 (#2320) (2ebbd8e)

1.8.19 (2022-05-11)

Bug Fixes

  • deps: update dependency torrent-discovery to ^9.4.12 (36e931a)

1.8.18 (2022-05-11)

Bug Fixes

  • deps: update dependency bittorrent-tracker to v9.18.6 (#2315) (b63d652)

1.8.17 (2022-05-11)

Bug Fixes

  • measure transfer rates without using timeouts (#2314) (522ee4c)

1.8.16 (2022-04-28)

Bug Fixes

  • deps: update dependency bittorrent-protocol to ^3.5.5 (3522080)

1.8.15 (2022-04-26)

1.8.14 (2022-04-22)

Bug Fixes

  • deps: update dependency bitfield to ^4.1.0 (#2303) (a778522)
  • deps: update dependency bittorrent-protocol to ^3.5.3 (#2302) (11f9426)

1.8.13 (2022-03-30)

Bug Fixes

  • deps: update dependency fs-chunk-store to ^2.0.5 (2eef418)

1.8.12 (2022-03-28)

Bug Fixes

  • deps: update dependency bittorrent-protocol to ^3.5.2 (13fb0d6)

1.8.11 (2022-03-27)

1.8.10 (2022-03-27)

Bug Fixes

1.8.9 (2022-03-26)

Bug Fixes

  • deps: update dependency parse-torrent to ^9.1.5 (650a8c9)

1.8.8 (2022-03-25)

Bug Fixes

  • deps: update dependency debug to ^4.3.4 (017c488)

1.8.7 (2022-03-24)

1.8.6 (2022-03-11)

Bug Fixes

  • deps: update dependency create-torrent to ^5.0.2 (#2276) (f389f87)

1.8.5 (2022-03-06)

Bug Fixes

  • deps: update dependency torrent-discovery to ^9.4.9 (5a08647)

1.8.4 (2022-03-03)

Bug Fixes

  • deps: update dependency torrent-discovery to ^9.4.8 (#2272) (aa2fa59)

1.8.3 (2022-02-21)

1.8.2 (2022-02-17)

Bug Fixes

  • deps: update dependency simple-peer to ^9.11.1 (34df41a)

1.8.1 (2022-02-03)

Bug Fixes

1.8.0 (2022-02-03)

Features

1.7.4 (2022-02-03)

Bug Fixes

1.7.3 (2022-02-03)

1.7.2 (2022-01-27)

Bug Fixes

1.7.1 (2022-01-20)

1.7.0 (2022-01-20)

Features

1.6.0 (2022-01-17)

Features

1.5.11 (2022-01-14)

Bug Fixes

1.5.10 (2022-01-14)

Bug Fixes

  • use @webtorrent/http-node (699d747)

1.5.9 (2022-01-12)

1.5.8 (2021-10-26)

Bug Fixes

1.5.7 (2021-10-25)

Bug Fixes

  • add storeOpts, specify store path, align with docs (#2121) (6cd9b5f)

1.5.6 (2021-10-05)

Bug Fixes

1.5.5 (2021-09-02)

Bug Fixes

1.5.4 (2021-08-25)

Bug Fixes

  • handle done event when new files selected (#2183) (c543788)

1.5.3 (2021-08-20)

Bug Fixes

  • deps: update dependency @webtorrent/semantic-release-config to v1.0.7 (#2175) (404de99)

1.5.2 (2021-08-20)

1.5.1 (2021-08-20)

Bug Fixes

  • deps: update dependency @webtorrent/semantic-release-config to v1.0.6 (#2173) (210bda9)

1.5.0 (2021-08-19)

Features

  • add service worker server as an alternative to renderMedia (#2098) (604943e)

1.4.0 (2021-08-17)

Features

1.3.10 (2021-08-16)

1.3.9 (2021-08-06)

Bug Fixes

  • deps: update dependency create-torrent to ^5.0.1 (#2167) (283cbf8)

1.3.8 (2021-08-06)

Bug Fixes

  • deps: update dependency create-torrent to v5 (#2165) (501fd9e)

1.3.7 (2021-08-05)

Bug Fixes

  • deps: update dependency torrent-discovery to ^9.4.4 (#2164) (fb59617)

1.3.6 (2021-08-05)

Bug Fixes

  • deps: update dependency bittorrent-dht to ^10.0.2 (#2163) (fc89c78)

1.3.5 (2021-08-04)

Bug Fixes

1.3.4 (2021-07-30)

Bug Fixes

1.3.3 (2021-07-25)

Bug Fixes

  • log error when failing to load blocklist ip set (c0a07fb)

1.3.2 (2021-07-24)

Bug Fixes

  • deps: update dependency speed-limiter to ^1.0.2 (#2153) (17fb0e2)

1.3.1 (2021-07-24)

Bug Fixes

1.3.0 (2021-07-23)

Features

1.2.6 (2021-07-23)

Bug Fixes

  • deps: update dependency create-torrent to ^4.7.1 (#2145) (a75f1aa)

1.2.5 (2021-07-19)

Bug Fixes

  • deps: update dependency bittorrent-dht to ^10.0.1 (#2139) (8476d9c)

1.2.4 (2021-07-13)

Bug Fixes

  • call public FileStream.destroy method so cb is defined (#2135) (b035cbe)

1.2.3 (2021-07-13)

Bug Fixes

1.2.2 (2021-07-11)

Bug Fixes

1.2.1 (2021-07-11)

Bug Fixes

1.2.0 (2021-07-09)

Features

1.1.6 (2021-07-08)

Bug Fixes

  • deps: update dependency bittorrent-protocol to ^3.4.2 (#2132) (7223cbf)

1.1.5 (2021-07-06)

Bug Fixes

1.1.4 (2021-07-03)

Bug Fixes

1.1.3 (2021-07-02)

Bug Fixes

1.1.2 (2021-07-02)

1.1.1 (2021-07-02)

Bug Fixes

1.1.0 (2021-06-30)

Features

1.0.4 (2021-06-30)

1.0.3 (2021-06-30)

Bug Fixes

1.0.2 (2021-06-23)

Bug Fixes

  • enable UTP by default if there's support (0df9eb6)

1.0.1 (2021-06-17)

Bug Fixes

1.0.0 (2021-05-21)

Bug Fixes

chore

Reverts

  • version strategy gh actions (1cba675)

BREAKING CHANGES

  • chore: add release
  • add semantic release config
  • Update release.yml

WebTorrent Version History

v0.112.0 - 2020-11-05

  • Ensure that appendTo callback is called once video tag is added to DOM, not after play (#1967)

v0.111.0 - 2020-11-05

  • Add Local Service Discovery (BEP14)
  • bitfield@4

v0.110.1 - 2020-11-03

  • Fix BEP53 implementation

v0.110.0 - 2020-11-03

  • Support Implement the peer address property (x.pe) from BEP09

v0.109.2 - 2020-10-27

  • Fix "Cannot read property 'utp' of null"

v0.109.1 - 2020-10-23

  • Peer reconnect timeout throwing error after torrent is destroyed

v0.109.0 - 2020-10-22

  • refactor torrent._rechoke()
  • simple-get@4
  • electron@9
  • deps
  • Add stale bot config
  • Create no-response.yml
  • Create config.yml
  • Update no-response.yml
  • Add uTP support (BEP29)
  • check if torrent is destroyed before emitting download/upload event
  • ut_pex 2.0.1
  • browserify@17
  • electron@10

v0.108.6 - 2020-05-29

  • update deps

v0.108.5 - 2020-05-29

  • bump deps

v0.108.4 - 2020-05-28

  • add test for downloading from a manually added peer
  • fix: not setting initial wire interest
  • update interest when a peer's bitfield changes

v0.108.3 - 2020-05-15

  • Create webtorrent.chromeapp.js
  • update bittorrent-dht to version 10.0.0
  • Change parseRange.parse to parseRange

v0.108.2 - 2020-05-10

  • implement store destruction option
  • Fix drag-drop.min.js link
  • update parse-numeric-range to version 1.2.0
  • browsers: add tests for safari, edge, android, iphone

v0.108.1 - 2020-04-01

  • fix ratio calculation

v0.108.0 - 2020-04-01

  • Check if client is set when debug logging
  • downgrade end-of-stream to v1.4.1
  • private option overrides default, only if it's defined
  • use native Set instead of uniq library
  • Improve code readability

v0.107.17 - 2019-11-12

  • Unbreak built file

v0.107.16 - 2019-09-10

  • fix git commit reference to http-node package

v0.107.15 - 2019-09-10

  • Return server from server.listen for method chaining to work

v0.107.14 - 2019-09-10

  • Update .gitignore

v0.107.13 - 2019-09-10

  • Added tests to check the order of torrent events

v0.107.12 - 2019-09-08

  • Fixed how first piece's irrelevant bytes are calculated

v0.107.11 - 2019-09-07

  • Added timeout option for requestIdlecallback to prevent longer delays in download

v0.107.10 - 2019-09-07

  • Server now uses relative urls

v0.107.9 - 2019-09-07

  • Added a check in case user destroys torrent in response to metadata event

v0.107.8 - 2019-09-07

  • Fixed the torrent event emission order; now metadata is emitted before ready and done

v0.107.7 - 2019-09-06

  • Updated to simple-sha1@3
  • Updated jsdelivr urls to use latest Webtorrent

v0.107.6 - 2019-08-28

  • Fixed XSS vulnerability in the http Server (issue)

v0.107.5 - 2019-08-22

  • No meaningful changes

v0.107.4 - 2019-08-19

  • Added api documentation for some torrent properties
  • Bug fix: trackers now recieve 0 while seeding file instead of the file size
  • Updated org-wide security policies and contributing guidelines

v0.107.3 - 2019-08-10

  • No meaningful changes

v0.107.2 - 2019-08-09

  • Scripts are now more verbose

v0.107.1 - 2019-08-09

  • Updated to stream-to-bolob-url@3
  • Added chromeapp field to package.json for specifying Chrome App dependency substitutions

v0.107.0 - 2019-08-07

  • Smaller build with tinify
  • Added size-disc script to visualize bundle

v0.106.0 - 2019-08-05

  • Updated to electron@6
  • Dropped support for node versions < 10

v0.105.3 - 2019-08-02

  • Now uses 'application/octet-stream' mimetype as fallback instead of null

v0.105.2 - 2019-07-31

  • Fixed server hostname option to mitigate DNS rebinding attack (issue)

v0.105.1 - 2019-07-24

  • Bug fixed: Video streaming is now fixed in Brave nightly and chromium nightly (issue)

v0.105.0 - 2019-07-06

  • Updated to parse-torrent@7
  • Added manual verification for torrent files

v0.104.0 - 2019-06-29

  • Updated to chunk-store-stream@4
  • Updated to multistream@3
  • Updated to create-torrent@4
  • Dropped support for node versions < 8

v0.103.4 - 2019-06-19

  • No meaningful changes

v0.103.3 - 2019-06-19

  • Updated to electron@5

v0.103.2 - 2019-06-12

  • Added the ability to close and restore streaming server

v0.103.1 - 2019-03-11

  • Updated to electron@4
  • Bug fixed: File progress is no longer shown in negative

v0.103.0 - 2018-12-11

  • No longer verifies file hashes passed to seed
  • No longer calls torrent.load() when seeding FS filepath
  • Reduced download impact on slower computers: now download chunks at a lower priority (rationale)

v0.102.4 - 2018-08-31

  • No meaningful changes

v0.102.3 - 2018-08-31

  • Removed xtend
  • Removed the concurrency limit in browser
  • Reduced installtion size by removing zero-fill
  • Updated to bittorrent-dht@9

v0.102.2 - 2018-08-28

v0.102.1 - 2018-08-10

  • No meaningful changes

v0.102.0 - 2018-08-04

  • Updated to chunk-store-stream@3
  • Updated to immediate-chunk-store@2

v0.101.2 - 2018-07-27

v0.101.1 - 2018-07-27

  • Updated to bittorrent-protocol@3
  • Optimized peers: peers now start as uninterested and only move to interested if/once they have a piece that we need (webtorrent/#1059)

v0.101.0 - 2018-07-19

  • No meaningful changes

v0.100.0 - 2018-05-23

  • Implemented BEP53 to alow file selection using select only parameter in MagnetURIs (webtorrent/#1395)

v0.99.4 - 2018-05-03

  • Use updated babel-minify minifier instead of deprecated babili

v0.99.3 - 2018-04-26

v0.99.2 - 2018-04-24

  • Use .npmignore to prevent unneeded files from being included in the published package

v0.99.1 - 2018-04-24

  • Expose WebTorrent.VERSION (#1358)
  • Update to simple-get@3
  • Update to parse-torrent@6

v0.99.0 - 2018-04-19

  • renderTo()/appendTo() does not autoplay by default anymore (rationale)
    • Pass {autoplay: true} to renderTo()/appendTo() to get the old behavior.
  • renderTo()/appendTo() has a new muted option to mute the video by default.

v0.98.24 - 2018-03-02

  • Add hostname option to mitigate DNS rebinding (#1260)
  • Update to simple-peer@9
  • Browser testing: switch from zuul to airtap

v0.98.23 - 2018-02-20

  • Update to bitfield@2

v0.98.22 - 2018-02-17

  • Update to browserify@16
  • Update to bittorrent-dht@8
  • Update to pump@3

v0.98.21 - 2018-01-26

  • Update to pump@2
  • Update to mime@2
  • Update to cross-spawn@6
  • Update to browserify@15

v0.98.20 - 2017-10-17

  • Fix file.downloaded for last piece
  • Fix destroyed torrent debug
  • Update to mime@2
  • Update to debug@3
  • Update to electron@1

v0.98.19 - 2017-06-25

  • Add origin option for torrent.createServer() (#1096)
  • Add file.progress property (#1140)
  • Switch to ES6-compatible minifier

v0.98.18 - 2017-04-14

  • Transfer webtorrent from @feross to @webtorrent organization.

v0.98.17 - 2017-04-13

  • Fix uncaught exception (#1103)

v0.98.16 - 2017-04-07

  • Update to simple-peer@8

v0.98.15 - 2017-03-30

  • No meaningful changes

v0.98.14 - 2017-03-17

  • Add filename to URLs on server index page (#1078)

v0.98.13 - 2017-03-16

  • No meaningful changes

v0.98.12 - 2017-03-13

  • Fix files under 16Kb are not downloaded correctly (#1077)

v0.98.11 - 2017-03-13

  • Fix detection of seeding peers (#1076)

v0.98.10 - 2017-03-06

  • Update to bittorrent-tracker@9

v0.98.9 - 2017-03-01

  • Update to finalhandler@1
  • Update to simple-peer@7

v0.98.8 - 2017-02-13

  • wait to notify() or updateInterest() at end of GC (#1044)
  • Update to cross-spawn@5

v0.98.7 - 2017-02-11

  • Change os.tmpDir() to os.tmpdir() (#1043)

v0.98.6 - 2017-02-09

  • Refactor http server; support content-disposition (#1039)

v0.98.5 - 2017-02-02

  • Don't print debug log after torrent is destroyed

v0.98.4 - 2017-02-02

  • Be more defensive: prevent code from running after destroy
  • Fix "Cannot read property 'complete' of null" (#1022)
  • Include infoHash in torrent.js debug logs
  • Update to browserify@14

v0.98.3 - 2017-01-19

  • Emit more warnings (#1021)
  • Set user-agent header for http tracker requests (#1019)

v0.98.2 - 2017-01-18

  • Don't send 'completed' event to tracker on client.seed (#991)
  • Set user-agent header for http tracker requests (#962)

v0.98.1 - 2017-01-13

  • Don't emit 'completed' on client.seed
  • Do not choke on web seeds (#972)

v0.98.0 - 2016-11-23

  • Add property for downloaded bytes per file (file.downloaded) (#974)
  • Cross-origin HTTP redirect workaround for web seeds (#909)

v0.97.2 - 2016-09-26

  • Creating a WebTorrent client with the {tracker: false} to disable communication with trackers should not affect creating a torrent with .seed(). The resulting torrent file should still contain the normal announce field. (#928)
  • Add more peer ID entropy

v0.97.1 - 2016-09-17

  • Handle invalid range handers instead of throwing (#921)

v0.97.0 - 2016-09-17

  • Add option to disable BEP19 web seeds (webSeeds option to the WebTorrent constructor)

v0.96.5 - 2016-09-13

  • Fix exceptions in server.close() and server.destroy()

v0.96.4 - 2016-08-23

  • Warn when WebTorrent is installed on Node.js older than v4.0.0.

v0.96.3 - 2016-08-22

  • Better docs for .renderTo()

v0.96.2 - 2016-08-20

  • Replace 'hat' with 'randombytes'
  • Better debug logs

v0.96.1 - 2016-08-18

  • Prevent possible stack overflow

v0.96.0 - 2016-08-03

  • Add options to disable autoplay/hide controls with appendTo() and renderTo()

v0.95.6 - 2016-07-28

  • Allow deselecting the entire torrent with deselect() to happen earlier

v0.95.5 - 2016-07-26

  • Fix support for FileList input to client.seed()

v0.95.4 - 2016-07-26

  • Skip blocklist logic when opts.blocklist is not set

v0.95.3 - 2016-07-26

  • Fix WebTorrent version string

v0.95.2 - 2016-06-22

  • HEAD requests to HTTP server should not send entire body
  • WebTorrent, LLC is now the steward of the project

v0.95.1 - 2016-06-15

  • Emit 'seed' event on the torrent object

v0.95.0 - 2016-06-15

  • API: Add file.getBlob() method
  • Fix rare exception in lib/tcp-pool.js

v0.94.4 - 2016-06-10

  • Support torrent with a single 0 byte file
  • Use < since it handles NaN in a predictable way, i.e. false

v0.94.3 - 2016-05-30

  • Use safe-buffer for improved buffer safety

v0.94.2 - 2016-05-28

  • Fix rare exception in lib/file.js

v0.94.1 - 2016-05-26

  • Make WebTorrent user agent string consistent across whole codebase

v0.94.0 - 2016-05-19

  • Support exact source (xs) paramter of magnet URIs, for retreiving metadata

v0.93.4 - 2016-05-17

  • Fix rare exception caused by race condition in lib/peer.js

v0.93.3 - 2016-05-13

  • Don't unset {tracker: {wrtc: false}} option to WebTorrent constructor.

v0.93.2 - 2016-05-12

  • When a duplicate torrent is added, don't emit the 'infoHash' event after 'error'. The 'error' event should be the last event.

v0.93.1 - 2016-05-08

  • Remove path-exists dependency.

v0.93.0 - 2016-05-08

  • Move tracker options (rtcConfig and wrtc) into opts.tracker.

    Before:

    var client = new WebTorrent({ rtcConfig: {}, wrtc: {} })

    After:

    var client = new WebTorrent({ tracker: { rtcConfig: {}, wrtc: {} } })

v0.92.0 - 2016-05-05

  • Add new event: torrent.on('noPeers', function (announceType) {})

    Emitted whenever a DHT or tracker announce occurs, but no peers have been found. announceType is either 'tracker' or 'dht' depending on which announce occurred to trigger this event. Note that if you're attempting to discover peers from both a tracker and a DHT, you'll see this event separately for each.

v0.91.4 - 2016-05-05

  • Fix exception: "peer._destroy is not a function" when calling torrent.pause()

v0.91.3 - 2016-05-04

  • Fix torrent.swarm from causing an infinite recursion.

v0.91.2 - 2016-04-28

  • Test node v6

v0.91.1 - 2016-04-24

  • Emit 'done' event after sending the 'complete' message to the tracker.

v0.91.0 - 2016-04-21

Added

  • client.listening property to signal whether TCP server is listening for incoming connections.

  • client.dhtPort property reflects the actual DHT port when user doesn't specify one (this is parallel to client.torrentPort for the TCP torrent listening server)

Changed

  • Merged Swarm class into Torrent object. Properties on torrent.swarm (like torrent.swarm.wires) now exist on torrent (e.g. torrent.wires).

  • Deprecate: Do not use torrent.swarm anymore. Use torrent instead.

  • torrent.addPeer can no longer be called before the infoHash event has been emitted.

  • Remove torrent.on('listening') event. Use client.on('listening') instead.

  • Remove support from TCPPool for listening on multiple ports. This was not used by WebTorrent and just added complexity. There is now a single TCPPool instance for the whole WebTorrent client.

  • Deprecate: Do not use client.download() anymore. Use client.add() instead.

  • Only pass torrent.infoHash to the Chunk Store constructor, instead of the Torrent instance itself, to prevent accidental memory leaks of the Torrent object by the store. (Open an issue if you were using other properties. They can be re-added.)

  • Non-fatal errors with a single torrent will be emitted at torrent.on('error'). You should listen to this event. Previously, all torrent errors were also emitted on client.on('error') and handling torrent.on('error') was optional. This design is better since now it is possible to distinguish between fatal client errors (client.on('error')) when the whole client becomes unusable versus recoverable errors where only a single torrent fails (torrent.on('error')) but the client can continue to be used. However, if there is no torrent.on('error') event, then the error will be forwarded to client.on('error'). This prevents crashing the client when the user only has a listener on the client, but it makes it impossible for them to determine a client error versus a torrent error.

  • Removed torrent.numBlockedPeers property. Use the blockedPeer event to track this yourself.

Fixed

  • If client.get is passed a Torrent instance, it now only returns it if it is present in the client.

  • Errors creating a torrent with client.seed are now emitted on the returned torrent object instead of the client (unless there is no event listeners on torrent.on('error') as previously discussed). The torrent object is now also destroyed automatically for the user, as was probably expected.

  • Do not return existing torrent object when duplicate torrent is added. Fire an 'error' event instead.

  • Memory leaks of Torrent object caused by many internal subclasses of WebTorrent, including RarityMap, TCPPool, WebConn, Server, File.

  • client.ratio and torrent.ratio are now calculated as uploaded / received instead of uploaded / downloaded.

Previous versions

We did not maintain a changelog for versions prior to v0.91.0. The initial release of WebTorrent was on Dec 4, 2013.