WebTorrent 4 BitTorrent in the browser 4 True P2P implementation – not just a proxy 4 No install – pure JavaScript with WebRTC 4 Exposes files as node-style streams 4 Stream into , , VLC, Chromecast, Airplay, etc.
var WebTorrent = require('webtorrent') var client = new WebTorrent() client.add('magnet:...', function (torrent) { console.log('Got torrent metadata!', torrent.infoHash) torrent.files.forEach(function (file) { var video = document.createElement('video') document.body.appendChild(video) file.createReadStream().pipe(video) }) })
Data Channel API is easy! var channel = peer.createDataChannel() channel.send('hi') channel.addEventListener('message', function (event) { console.log('got message: ' + event.data) })
WebRTC support in Web Apps 4 Google Chrome - supported 4 Mozilla Firefox - supported 4 Opera - supported 4 Microsoft Edge (next IE) - planned 4 Apple Safari - no comment
WebRTC support in Desktop apps 4 Electron (atom-shell) - easiest choice! 4 NW.js (node-webkit) - also super easy! 4 Google's webrtc.org - compile it into your app 4 Ericsson's OpenWebRTC - compile it into your app
WebRTC support in Server apps 4 wrtc package on npm (native dep on webrtc.org) 4 Google's webrtc.org - compile it into your app 4 Ericsson's OpenWebRTC - compile it into your app
WebRTC support in Mobile apps 4 iOS - Google's webrtc.org - compile it into your app 4 Android - Use Chromium WebView 4 Or, better: Just use Chrome/Firefox on Android!
Finding peers 4 Easiest way is through a central tracker / introducer 4 signalhub (used by Friends) 4 bittorrent-tracker (used by WebTorrent) 4 We need a general purpose WebRTC DHT! 4 webrtc-explorer by David Dias
STUN 4 External service that aids in NAT traversal 4 Lots of services just use Google's public STUN server 4 You can run your own very cheaply 4 Possible privacy leak, but unlikely