WebRTC Everywhere (Beyond the Browser) @ Data Terra Nemo 2015

WebRTC Everywhere (Beyond the Browser) @ Data Terra Nemo 2015

Talk by Feross Aboukhadijeh (that's me!) at Data Terra Nemo 2015 (http://dtn.is).

https://webtorrent.io
https://instant.io
http://feross.org

B498d33041627b07726dc29c28f02df7?s=128

Feross Aboukhadijeh

May 23, 2015
Tweet

Transcript

  1. 3.

    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 <video>, <audio>, VLC, Chromecast, Airplay, etc.
  2. 4.

    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) }) })
  3. 5.

    Astro Bob Ren Daniel Posch Feross Aboukhadijeh Iván Todorovich John

    Hiesey Joseph Dykstra Mathias Buus Travis Fischer many more...
  4. 6.

    P2P

  5. 8.
  6. 10.
  7. 11.

    WebRTC is a backdoor 4 Companies just want browser video

    chat 4 But they're building P2P into the fabric of the web 4 Let's use this opportunity!
  8. 13.

    Data Channel Unintended Consequences 4 Peer-assisted delivery (PeerCDN, Peer5, others)

    4 File transfer (WebTorrent, Sharefest) 4 Website hosting over torrents 4 Chat/email/encrypted real-time communications 4 All future P2P protocols!
  9. 18.

    This is WebRTC Everywhere 4 WebRTC in web apps (desktop

    & mobile) 4 WebRTC in desktop apps 4 WebRTC in server apps 4 WebRTC in mobile apps
  10. 24.

    Data Channel API is easy! var channel = peer.createDataChannel() channel.send('hi')

    channel.addEventListener('message', function (event) { console.log('got message: ' + event.data) })
  11. 26.

    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
  12. 27.

    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
  13. 28.

    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
  14. 29.

    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!
  15. 34.
  16. 37.

    No "Data Channel only" build 4 All implementations include media

    component cruft 4 Data channel build: code.google.com/p/webrtc/ issues/detail?id=3892
  17. 39.
  18. 41.

    Offer/answer connection model 4 IP/UDP/TCP is like calling a phone

    number 4 WebRTC is like getting set up on a date
  19. 43.

    In browser, you need a domain name 4 Possible solution:

    Make it work offline! 4 hyperboot.org 4 Service Workers
  20. 44.

    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
  21. 45.

    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
  22. 46.

    Privacy leak 4 Any webpage can query your local IPs

    4 Chrome disables local candidates on proxy/VPN 4 Tor Browser Bundle disables WebRTC
  23. 47.

    Streaming is a challenge 4 No readable backpressure 4 Writable

    backpressure is hacky 4 bufferedAmount 4 setInteval
  24. 54.
  25. 55.
  26. 56.

    apps that use simple-peer 4 Friends - P2P chat 4

    ScreenCat - Screen sharing 4 WebTorrent - browser torrent client 4 Whiteboard - draw together 4 Lots of experiments: webrtc-explorer, peernet, rtcat, webcat ...