You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fundamentally, the way the web works currently like this:
All request / response to the World Wide Web is actually based on the ip address of your router / modem. This is not gonna work for P2P. For P2P, you need to establish a direct connection from computer to computer. We use a STUN server to help establish a connection between 2 computers directly. Unfortunately, STUN server can't help you establish direct connections when a computer is within an complex internal network with VPNs and Proxies (usually within corporate companies). When this happens, you can use a TURN server. Since direct P2P cannot be established, TURN server handles media and data like a middleman between 2 computers.
Since TURN server may have to handle alot of media data, companies usually don't let you use their TURN server for free. Good news is, you can set one up yourself for free
We will be building a group video chat app.
Overview:
When the page loads, we try to get the user's webcam. After getting it, we run the sendBroadcast function that broadcasts an event to tell everyone in the channel that I have a video! Eventname: broadcastAvailable.
When the page receives a broadcastAvailable event, the page checks to see if the
Watchers (/watch) are gonna receive the event. If they are already watching that stream, then they're like... I can ignore this. Otherwise, they'll send a message to the broadcaster saying... I want this. Let's call that event getBroadcast.
When Broadcaster receives the getBroadcast event, it creates a peer connection object with a stun server (provided by google woohoo!). Then when it receives an ICE Candidate (aka information about its client data), it needs to send that to the watcher: iceOfferCandidate.
Watcher receives iceOfferCandidate event, creates a peerConnection and adds the offerCandidate
The text was updated successfully, but these errors were encountered:
WEBRTC
Prerequisites
Fundamentally, the way the web works currently like this:
All request / response to the World Wide Web is actually based on the ip address of your router / modem. This is not gonna work for P2P. For P2P, you need to establish a direct connection from computer to computer. We use a
STUN
server to help establish a connection between 2 computers directly. Unfortunately,STUN
server can't help you establish direct connections when a computer is within an complex internal network with VPNs and Proxies (usually within corporate companies). When this happens, you can use aTURN
server. Since direct P2P cannot be established, TURN server handles media and data like a middleman between 2 computers.Since TURN server may have to handle alot of media data, companies usually don't let you use their TURN server for free. Good news is, you can set one up yourself for free
We will be building a group video chat app.
Overview:
sendBroadcast
function that broadcasts an event to tell everyone in the channel that I have a video! Eventname:broadcastAvailable
.broadcastAvailable
event, the page checks to see if the/watch
) are gonna receive the event. If they are already watching that stream, then they're like...I can ignore this
. Otherwise, they'll send a message to the broadcaster saying...I want this
. Let's call that eventgetBroadcast
.getBroadcast
event, it creates a peer connection object with a stun server (provided by google woohoo!). Then when it receives anICE Candidate
(aka information about its client data), it needs to send that to the watcher:iceOfferCandidate
.iceOfferCandidate
event, creates a peerConnection and adds the offerCandidateThe text was updated successfully, but these errors were encountered: