Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RangerMauve/62501c98b42c63f2de6ee0644a6852ff to your computer and use it in GitHub Desktop.
Save RangerMauve/62501c98b42c63f2de6ee0644a6852ff to your computer and use it in GitHub Desktop.
WebRTC Signaling with Dat
WebRTC, unlike Dat, requires doing a handshake through a third party.
With beaker, that third party can be the existing P2P connections that you have.
To connect between two peers you need to do the following:
- Create a Dat Archive for the call website
- Listen on messages in the [dat-peers API](https://beakerbrowser.com/docs/apis/experimental-datpeers)
- Have the user enter a "room"
- Set up the WebRTC connection, send the SDP handshake and the `room` through datPeers
- When you get messages for your room, pass them to the local PeerConnection as being remote SDP or ICE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment