This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a bare bones example of creating a data channel between two WebRTC | |
// peers. Let's imagine two peers trying to connect to each other. We'll call | |
// one the "offer peer", and the other the "answer peer". The offer peer will | |
// be the one initiating a connection, and the answer peer will be the one | |
// responding to it. | |
// | |
// The two peers must use a separate connection to negotiate their connection. | |
// A websocket connection to a shared server is often used for this negotiation. | |
// They will exchange offers and answers using the websocket. Each peer will | |
// also attempt to discover more details about themselves (ICE), such as their |