Slide 1

Slide 1 text

WebRTC Everywhere by Feross

Slide 2

Slide 2 text

WebRTC Beyond the Browser

Slide 3

Slide 3 text

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.

Slide 4

Slide 4 text

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) }) })

Slide 5

Slide 5 text

Astro Bob Ren Daniel Posch Feross Aboukhadijeh Iván Todorovich John Hiesey Joseph Dykstra Mathias Buus Travis Fischer many more...

Slide 6

Slide 6 text

P2P

Slide 7

Slide 7 text

POWER TO THE PEOPLE

Slide 8

Slide 8 text

Freedom

Slide 9

Slide 9 text

True personal computing

Slide 10

Slide 10 text

WebRTC

Slide 11

Slide 11 text

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!

Slide 12

Slide 12 text

WebRTC Data Channel

Slide 13

Slide 13 text

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!

Slide 14

Slide 14 text

WebRTC Whiteboard Demo

Slide 15

Slide 15 text

WebRTC Whiteboard whiteboard.webtorrent.io

Slide 16

Slide 16 text

WebRTC Whiteboard whiteboard.webtorrent.io github.com/feross/whiteboard

Slide 17

Slide 17 text

Another unintended consequence... WebRTC beyond the browser

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

WebRTC is universal

Slide 20

Slide 20 text

Only transport that works in the browser

Slide 21

Slide 21 text

You get NAT traversal for free

Slide 22

Slide 22 text

No cross-origin policy

Slide 23

Slide 23 text

Mandatory transport encryption

Slide 24

Slide 24 text

Data Channel API is easy! var channel = peer.createDataChannel() channel.send('hi') channel.addEventListener('message', function (event) { console.log('got message: ' + event.data) })

Slide 25

Slide 25 text

Where does WebRTC work today?

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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!

Slide 30

Slide 30 text

Electron is awesome!

Slide 31

Slide 31 text

Same code in both places Demo

Slide 32

Slide 32 text

friends github.com/moose-team/friends

Slide 33

Slide 33 text

You can run it headless! github.com/maxogden/electron-spawn

Slide 34

Slide 34 text

Slide 35

Slide 35 text

There are challenges, and even some deal breakers

Slide 36

Slide 36 text

WebRTC deal breakers

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

Not as lightweight as UDP 4 Even after optimization, it won't ever be

Slide 39

Slide 39 text

No IE/Safari support yet 4 Consider using Temasys plugin 4 Microsoft Edge support coming soon

Slide 40

Slide 40 text

WebRTC challenges

Slide 41

Slide 41 text

Offer/answer connection model 4 IP/UDP/TCP is like calling a phone number 4 WebRTC is like getting set up on a date

Slide 42

Slide 42 text

Single points of failure remain!

Slide 43

Slide 43 text

In browser, you need a domain name 4 Possible solution: Make it work offline! 4 hyperboot.org 4 Service Workers

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

Privacy leak 4 Any webpage can query your local IPs 4 Chrome disables local candidates on proxy/VPN 4 Tor Browser Bundle disables WebRTC

Slide 47

Slide 47 text

Streaming is a challenge 4 No readable backpressure 4 Writable backpressure is hacky 4 bufferedAmount 4 setInteval

Slide 48

Slide 48 text

Despite challenges, we should rally around WebRTC

Slide 49

Slide 49 text

We need more P2P apps

Slide 50

Slide 50 text

We need more P2P primitives

Slide 51

Slide 51 text

LET'S MAKE THE MAN A BIT HUMBLER

Slide 52

Slide 52 text

"The sharing economy is mainly owned by the 1%" @jowyang

Slide 53

Slide 53 text

simple-peer

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

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

Slide 57

Slide 57 text

bittorrent-dht

Slide 58

Slide 58 text

Learn more about WebRTC "html5rocks webrtc basics" webrtchacks.com "simple-peer" on npm

Slide 59

Slide 59 text

Learn more about WebTorrent webtorrent.io instant.io