Download files using the WebTorrent protocol (BitTorrent over WebRTC).


var WebTorrent = require('webtorrent') var client = new WebTorrent() // Sintel, a free, Creative Commons movie var torrentId = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&' client.add(torrentId, function (torrent) { // Torrents can contain many files. Let's use the .mp4 file var file = torrent.files.find(function (file) { return'.mp4') }) // Display the file by adding it to the DOM. // Supports video, audio, image files, and more! file.appendTo('body') })