WebRTC once was the posterboy of a new wave of browser applications, which relieved us of hassle-full video conferencing and brought us tools like appear.in & Google Hangouts. It kinda is like that character of your favourite TV-Show that is so identified with the role, that they can not land a new job in any other series.
It's time to break the curse, because WebRTC has so much more to offer than just video conferencing! I'll invite you to join me on an explorative mission in the land of WebRTC Datachannels and all sorts of crazy networking experiments, that'll will lead us to the land of "HTTP via WebRTC" on an continent called "The Decentralized Web"
34. Dealer
Create Offer Set Remote Description
Create Answer
Initiator
Signaling
Server Recipient
Signaling Server Tells Other Peer that we’re there
Peer creates An Answer & Sends it
38. Dealer
Set Remote Description
Create Answer
Create Offer
Set Remote Description
Initiator
Signaling
Server Recipient
Signaling server sends DescriptiOn to Peer
40. Browser
Js App
Browser
Js App
Handshake
Stun Stun
Who Am I?
Get Ip
(Nat Traversal)
Get Encryption Key
Who Am I?
Get Ip
(Nat Traversal)
Get Encryption Key
Dealer
My
Peers?
My
Peers?
Message
47. Requests a Ressource via HTTP
Service Worker Intercepts request
HTTP
Request(s)
BrowserBrowser
48. Service
Worker
Checks if request should be fetched via RTC
SENDs a POST-Message to the Main thread
HTTP
Request(s)
PostMessage
REQ Content
49. Sends the HTTP request via WebRTC datachannel
HTTP
Request(s)
PostMessage
REQ Content WebRTC MSG
REQ Content
Browser
50. Service
Worker
Turn the RTC Msg into an <http.IncomingMessage>
Feeds the Data into userland Code
Takes the Response & Sends it as an RTC MSG
HTTP
Request(s)
PostMessage
REQ Content WebRTC MSG
REQ Content
WebRTC MSG
RESP Content
Rpi
51. Dispatches the RPC MSG VIA Post Message to SW
HTTP
Request(s)
PostMessage
REQ Content WebRTC MSG
REQ Content
WebRTC MSG
RESP Content
PostMessage
RESP Content
Browser
52. Service
Worker
Turns the Post Message Content into an HTTP RESP
Answers the original HTTP request
HTTP
Request(s)
PostMessage
REQ Content WebRTC MSG
REQ Content
WebRTC MSG
RESP Content
PostMessage
RESP Content
HTTP
Response(s)
65. 📹 IT’s not only about Video conferencing
🌏 It’s Not only meant for the web (NAtive, c++, etc.)
📦 General Purpose Data transfer
💌 Data channels allow Message passing between peers
↔ Bidirectional Transfer of Text & Binary
⏰ Real time
📃 SCTP - Provides both, UDP AND TCP SEMANTICS
🤯 wonderful new-ish tool to have fun with
66. 😃 Local Peer Connection without stun & Signaling
🤕 Firefox is a bit stubborn
🙃 Performance & Reliability
😰 Keep the Lib size below 2kb
🥳 More Signaling adapters
🤓 Create a Websocket facade
😅 Release the packages
🤯