Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking for WebRTC connectivity - reliable methods

I have a live video chat application and I use a TURN server which supports STUN/TURN and both UPD/TCP transmission.

Sometimes users can be connected to the network which blocks that much ports and protocols that WebRTC connection just cannot happen (usually those are corporate networks). I would like to check if a WebRTC connection is possible before users try to connect to each other (actually, perform a technical check).

How can I do it? Ideas I have in my head:

  1. Try to download a hosted chunk of data (audio file, for example) via WebRTC - is it possible and would this be enough to make sure both inbound and outbound connections are open?
  2. Use a TURN server as a host to make a connection to and see if it fails (have no idea if I can do it or not)
  3. Use Flash to try to download/upload a chunk of data over specific ports and protocols. May be even using Cirrus. However, I am not sure this test will be accurate from WebRTC prospective.
  4. Any other ideas?

Additional requirement: the checking technique must support Chrome, Opera and Firefox. Preferably also IE/Safari via Temasys plugin.

Edition 1 - gathering ICE candidates is a good idea, however, it is not 100% reliable. Once I checked logs in my application and it actually gathered relay ICE candidates, but video/audio transmission failed. Tested on Apprtc as well and got same results.

like image 581
igorpavlov Avatar asked Apr 28 '26 06:04

igorpavlov


1 Answers

The best way to check is to connect with just a data channel first. Your users won't notice. If that works then audio and video are almost guaranteed to work. As a bonus, you can use the data channel for signaling for super-fast connecting when your users are ready.

like image 51
jib Avatar answered May 04 '26 12:05

jib



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!