Open cromo opened 3 years ago
One thing to discuss would be the ICE failed, add a STUN server and see about:webrtc for more details
error. I haven't figured this one out yet, but it's probably worth mentioning.
Interestingly, I found a reddit post about this issue where they mention that using localhost addresses can cause issues. Accessing it via IP address got past this error, though there are still issues with adding ICE candidates.
The two examples I used were Mozilla's simple data channel example and wrtc
's examples, mainly the ping-pong example.
I misread how ICE candidates were being handled in the Mozilla approach - I missed that ICE candidates were being passed to the peer's connection; instead I was passing them to the local connection (which caused issues). I also found out that wrtc
's examples cheat on the ICE candidate exchange and don't follow the typical flow - it sends the localDescription
after waiting for all ICE candidates since it's an offer containing the ICE candidates.
This would be an example of the simplest possible way to set up a WebRTC connection between two endpoints without any P2P data exchange. Why? After searching around for tutorials, everyone wants to build Skype clones, but all I want to do is get a UDP connection that I can send some data over. Many of the tutorials I've found use some library or third party service to help with setting up the connections, or spend half the tutorial setting up a server and websockets before getting to the interesting content. Furthermore, nothing seems to explain the flow to follow to get WebRTC working from first principles (given some API documentation), so some diagrams explaining the connection flow would be helpful.