3 ms·
I think you can do it in a weekend, maybe two! You are going to implement the simplest parts. This is what it would look like. It also depends on what libraries
by Sean-Der 3y ago
I think you can do it in a weekend, maybe two! You are going to implement the simplest parts. This is what it would look like. It also depends on what libraries you have available.
# Accepting an Offer
Parse the Session Description (remote's Offer). Grab the relevant values (ice username+password and certificate fingerprint)
# Generate your local state
Listen on a random UDP port for ICE. Generate a local ICE Username+Password. Generate a certificate for DTLS.
# Generate your Answer
Create an Answer that includes your IP, Port, ICE Username, ICE Password and Certificate Fingerprint.
# Connecting over ICE
Process the inbound STUN packets. Authenticate them with the remote ICE Username+Password. Respond with your local Username and Password.
# DTLS Handshake
Perform a DTLS handshake over the connection established via ICE. Make sure the remote certificate matches the one in the Offer.
# SCTP Association
Over DTLS create a SCTP Association. You now can exchange data streams!
-----
If you have a SDP, ICE, DTLS and SCTP library this should be ~250 lines of code. If you are missing any of those you will have to do a little more work. SDP and ICE could be done in a weekend. SCTP could be done in two weekends. DTLS I found a lot harder!
All of these estimates are for the simplest implementation. You could have years of work ahead of you depending on how far you want to take it :)
- remram 3y agoYeah that make me want to stay away from this. Even for you, who obviously know more about ICE and SCTP than I do, this is a lot of components.
- Sean-Der 3y agoYou could totally do it, but if it doesn’t sound interesting I get it :) WebRTC is made up of composable parts which I really appreciate. Makes it seem more complicated though.