[HN Gopher] Show HN: Learn how WebRTC actually works. A book on ...
       ___________________________________________________________________
        
       Show HN: Learn how WebRTC actually works. A book on the protocols,
       not just APIs
        
       Author : Sean-Der
       Score  : 316 points
       Date   : 2020-08-30 15:43 UTC (7 hours ago)
        
 (HTM) web link (webrtcforthecurious.com)
 (TXT) w3m dump (webrtcforthecurious.com)
        
       | Sean-Der wrote:
       | Hey HN! This is a book I am working on to help de-mystify WebRTC.
       | It is wonderful technology, but many find it hard to understand.
       | Especially if you don't have a telephony background. Before this
       | I worked on https://github.com/pion/webrtc and
       | https://github.com/awslabs/amazon-kinesis-video-streams-webr...
       | 
       | I wanted to share all my knowledge from working on these.
       | 
       | ------
       | 
       | Come learn about the WebRTC specification and how all the
       | protocols work in depth, not just a tour of the APIs. The book is
       | completely Open Source and available at
       | https://github.com/webrtc-for-the-curious/webrtc-for-the-cur...
       | 
       | Learn the full details of ICE, SCTP, DTLS, SRTP, and how they
       | work together to make up the WebRTC stack.
       | 
       | Hear how WebRTC implementers debug issues with the tools of the
       | trade.
       | 
       | Listen to interviews with the authors of foundational WebRTC
       | tech! Hear the motivations and design details that pre-dated
       | WebRTC by 20 years.
       | 
       | Explore the cutting edge of what people are building with WebRTC.
       | Learn about interesting use cases and how real-world applications
       | get designed, tested and implemented in production.
       | 
       | Written by developers who have written all of this from scratch.
       | We learned it the hard way, now we want to share it with you!
       | 
       | This book is vendor agnostic and multiple Open Source projects
       | and companies are involved. We would love to have you involved!
       | 
       | reply
        
         | the-dude wrote:
         | Hi Sean,
         | 
         | I remember your username from earlier posts, IIRC also quality
         | content about WebRTC or similar ( implementation? )
         | 
         | I am not a writer, but did get some extended language
         | education, and I suggest you get rid of most exclamation marks
         | in your texts.
         | 
         | It makes the reading ... boring might the wrong word ( not a
         | native speaker ).
         | 
         | Good luck and many thanks for your contributions.
        
           | Sean-Der wrote:
           | Thanks for the feedback. I agree.
           | 
           | When talking to people I really want to emote. I am self
           | conscious that people will think I am not interested/excited
           | in the conversation. Through most of my life
           | 'programming/tech' was something that I cared about. I never
           | had any friends/family that cared though. When I became an
           | adult and started working it felt like a re-birth of sorts :)
           | 
           | I just don't ever want anyone else to feel like I am not
           | interested/excited. I will try dropping the exclamation
           | points, and I hope that my enthusiasm still comes through.
        
             | the-dude wrote:
             | Just to be clear : I am talking about the book, not your HN
             | comment ( for example at
             | https://webrtcforthecurious.com/docs/01-what-why-and-how/
             | there are multiple examples )
        
             | ficklepickle wrote:
             | Wow, me too! And I also use lots of exclamation marks when
             | I write! You explained it better than I could have. Glad
             | I'm not the only one.
        
             | lowercased wrote:
             | My suggestion would be to throw in related illustrative
             | real world anecdotes that drive a point home (personal
             | experiences of real world impact of the tech or the
             | architecture decisions, for example) instead of exclamation
             | marks. That conveys the 'interested' part, and shows you
             | can demonstrate real world connections to stuff that might
             | otherwise be dry and academic. But it doesn't use
             | exclamation marks! ;)
        
       | jbaudanza wrote:
       | This is great! I just spent the weekend researching WebRTC for a
       | language learning project I'm working on. I have a few questions
       | about SFUs. Maybe someone here can help.
       | 
       | 1. SFUs seem to be the clear winner for multi-party calls. Do
       | they provide any advantage for 1-on-1 calls over peer'd
       | connections? It seems like using an SFU in this case would double
       | the number of connections, and hence double the connection
       | issues.
       | 
       | 2. Do clients communicate with SFUs by establishing a normal
       | RTCPeerConnection like they would with another peer? Or is there
       | some other video sharing protocol for SFUs that I don't know
       | about?
        
         | kodablah wrote:
         | 1. Not as much benefit for 1-on-1 except that you can guarantee
         | connectivity without a STUN server, can get a bit more
         | predictable network paths from client to server than client to
         | client, and can abstract choosing the best simulcasted stream
         | quality. It won't double the connection count, but it can make
         | you upload unnecessary streams in the case of simulcast,
         | because the client won't be the one determining which stream
         | quality is best, it'll just send multiple.
         | 
         | 2. Yup, SFU acts like another client. Some libs do one
         | connection for up and one for down or other ways to handle
         | stream multiplexing, but overall it's the same WebRTC peer
         | connections.
        
           | jbaudanza wrote:
           | Thank you! This is very helpful! We are doing mostly 1-on-1
           | calls, so I'm considering if peered connections would be
           | better. They're certainly cheaper. I hadn't considering
           | simulcasting multiple quality streams. That's something to
           | think about.
           | 
           | By "doubling connection count" I mean CLIENT <-> SFU <->
           | CLIENT is twice as many as CLIENT <-> CLIENT.
        
             | j1elo wrote:
             | Some do peer to peer for 1:1, then upgrade to actually
             | using the SFU for more participants. But that's a challenge
             | on its own, so when more than 1:1 is expected, you might
             | just prefer to use SFU from the start, and save the hassle
             | for when to switch between those two models
        
       | nottorp wrote:
       | Any hints on getting the browser makers to enable us to _disable_
       | it?
       | 
       | I gave up on Chrome because it was preventing my mac from
       | sleeping because "webRTC has active peer connections". Before de
       | mistifying its inner workings, you may want to address why we'd
       | want it and why it messes with power management.
        
         | stjohnswarts wrote:
         | You'll never get that. You'll just have to opt out of it. i
         | think there is an extension or two to turn it off in chrome.
         | Maybe that will fix your problem? Also I think there is just a
         | bool to turn off in firefox as well.
        
         | redmattred wrote:
         | I would imagine contacting the browser makers could be a good
         | start
        
           | nottorp wrote:
           | Google? I don't think I could get this topic to the top of HN
           | and I don't know anyone high in the food chain at Google.
           | So... that wouldn't work.
        
       | ptsneves wrote:
       | I made a live drone broadcasting platform called drohub at
       | https://drohub.xyz based on webrtc. Webrtc is hard indeed even
       | with the help of Janus gateway. Will definetly have a read, as I
       | still consider myself a noob on it. Hope you get good feedback.
        
       | PaulBGD_ wrote:
       | Sean is amazing and has great expertise with webrtc, excited to
       | read this :)
        
       | frequentnapper wrote:
       | Hi, thanks for this and making it freely available. just
       | wondering why you chose the license to waive all attribution as
       | well?
        
         | Sean-Der wrote:
         | I don't want to make the book (or my other projects) to be
         | about me. Some developers use their Open Source projects to
         | further their celebrity. Then no one else wants to contribute,
         | why just help someones vanity project. The projects languish
         | and die out.
         | 
         | So I try not to put my name on things, and license liberally.
         | My hope is that Pion and 'WebRTC for the Curious' will generate
         | more of a community.
        
           | j1elo wrote:
           | Your stance is very nice and good intended, but I don't think
           | being attributed your work should be a problem at all in
           | forming a good community. IMHO the ingredients are not
           | necessarily extreme humbleness and having the most liberal
           | licensing, instead actually _good_ contents and just basic
           | politeness  / not thinking of oneself as a superior being,
           | should be enough.
           | 
           | Probably something like the GNU Free Documentation License
           | [1] could have been also perfectly fine. It would also
           | prevent some shark from waiting until the text is complete
           | and polished and then take the work of authors and
           | contributors and sell it while passing it as their own. And
           | that's quite a nice feature in my book (pun intended)
           | 
           | Whatever, I like the idea of making this the best possible
           | resource for all things WebRTC :-)
           | 
           | [1]:
           | https://en.wikipedia.org/wiki/GNU_Free_Documentation_License
        
       | nerdbaggy wrote:
       | This is fantastic!!! Really well done.
        
         | Sean-Der wrote:
         | Thanks! Hopefully you learned something. If you have any ideas
         | on how to make it better would love to hear :)
        
       | atum47 wrote:
       | I was fiddling with webrtc last week and I end up creating a very
       | simplistic video chat. I was amazed on how easy it is to
       | implement that kind of stuff. server (signaling) and client
       | didn't took more than a few hundred lines of JS code.
       | 
       | I was determined to make a real app out of it, but everything I
       | could think of, there were already other people doing similar
       | stuff.
       | 
       | But its a nice piece of tech WebRTC, really impressed me.
       | 
       | here's my video chat in action:
       | https://www.youtube.com/watch?v=YbQsQqbt70g (no audio cause I was
       | using it to capture me speaking for the video recording)
        
         | kodablah wrote:
         | I strongly suggest, for your next step up as a JS person, to
         | take a peek at mediasoup.org. P2P has obvious scalability
         | limitations. That lib not only makes server side forwarding
         | easy (once you read example code), but it abstracts a lot of
         | real-world needed WebRTC features such as simulcast and
         | bandwidth estimation. You'll be making high quality Zoom-like
         | pages in no time (beware though, the dev community ain't great
         | for that lib because at least one of the authors comes off
         | quite rude in the forums).
         | 
         | Also I'd be remiss to not point out the OP's own pion Go libs
         | which do similar on the server side.
        
           | atum47 wrote:
           | I'll check it out. thanks for the suggestion.
        
         | ipnon wrote:
         | I suspect we will see a deluge of video chat apps in the near
         | future. They will be similar to the wave of chat apps that
         | appeared around 2015. I hope that the technology will mature
         | soon. The current state of video communication seems
         | improvable.
        
           | atum47 wrote:
           | well, I thought about doing a video chat over some game play,
           | so two friends could play a match of anything while having a
           | video conversation, next day some one posted something
           | similar here on HN.
           | 
           | I then thought about drawing on top of the video stream so
           | you can use as like one os those games where you have to
           | guess what the other people is drawing or, to coach someone
           | one to one and being able to "comment" on their screen as
           | they speak, but again, I'm pretty sure every video chats does
           | that. So I left the idea on the drawer for now.
           | 
           | https://www.youtube.com/watch?v=yS3_CRr7tys (draw on the
           | stream)
        
             | fttx_ wrote:
             | Any chance you can link the first one (video chat over
             | gameplay)? I'm working on something similar. I've tried
             | searching and didn't turn up all that much.
        
       | fictorial wrote:
       | For a client I created a telehealth system for mobile and desktop
       | browsers atop Twilio Video and later OpenTok.
       | 
       | As an experiment in cost savings, I dove into the details and
       | made a raw WebRTC version which worked well for a small number of
       | users in peer to peer mode.
       | 
       | While I found plenty of device farms, none allowed use the device
       | camera and mic.
       | 
       | How would you test a raw WebRTC video chat system short of buying
       | a bunch of devices every generation?
        
       | spicyramen wrote:
       | I started working with webrtc and compatibility across browsers
       | was a problem not sure if now it's been standardized
        
         | j1elo wrote:
         | It still is, but webrtc-adapter [1] aims to provide shims
         | wherever they are needed to transparently provide the same API
         | across all supported browsers
         | 
         | [1]: https://github.com/webrtchacks/adapter
        
       | 5986043handy wrote:
       | I remember working on a simple peer-peer chat using WebRTC [1]
       | and it took me a long time to actually grok what the whole
       | protocol was and how it worked, even with off-the-shelf libraries
       | available. This would have saved me so much time!
       | 
       | [1] https://github.com/cktang88/markdown-chat
        
         | Sean-Der wrote:
         | Thanks :)
         | 
         | It is really empowering to build stuff quickly. When you hit
         | that wall of abstraction it is so frustrating (especially when
         | debugging).
         | 
         | If there are any topics/ideas you have would love to hear! I
         | want this to be a community owned resource.
        
         | nmyk wrote:
         | This is great! I recently built a similar thing because I
         | wanted to learn more about WebRTC. Fun to see someone else's
         | take.
         | 
         | https://tmpch.at
        
       | pfyy wrote:
       | Great, this would have helped us a lot in the implementation of a
       | remote control app we did with webrtc. In my opinion, the best
       | available resource at the moment is https://hpbn.co/webrtc/.
       | (Also about a lot of other protocols)
        
       | linguinj wrote:
       | I create this website using webRTC to play torrent videos
       | https://popcorntime.tube/ on the browser
        
         | axegon_ wrote:
         | Hah! OK, now that is cool. Props!
        
       | tumetab1 wrote:
       | When you mention a protocol can clarify on what ISO/Stack it's?
       | 
       | I have no idea if ICE is application protocols or connection and
       | that really would me be understand the first chapter.
       | 
       | Just add something like "ICE (at the same stack level as
       | TCP/TLS/HTTP".
        
         | Sean-Der wrote:
         | Will do! ICE is layer 4(I think ?)
         | 
         | ICE is used to establish connectivity over UDP, TCP, TLS or
         | DTLS. With a preference in that order. It just keeps falling
         | back to more expensive transports if the prior ones failed.
        
       ___________________________________________________________________
       (page generated 2020-08-30 23:00 UTC)