libpeer icon indicating copy to clipboard operation
libpeer copied to clipboard

Permissions and candidates

Open richlegrand opened this issue 2 years ago • 1 comments

Hello, I'm playing with libpeer running on an ESP32 and I'm noticing some interesting behavior. I'm running Chrome and if I give the page permission to use the microphone, it's able to connect. It generates 8 candidates in the sdp answer, including IPV4 candidates, but it takes about 10 seconds to generate all of these candidates. But if I don't give it permission, it only generates 2 mdns candidates and 2 IPV6 candidates -- it takes very little time to generate the candidates, and it won't connect.

Digging into this some more, it has to do with mdns candidates... in ports.c in ports_resolve_mdns_host, it successfully gets the address, but returns -1. Fixing this by returning 0 the connection proceeds and I can send data. (nice! and great work btw, getting mdns working except for this tiny issue on esp32. :)

I'm curious if anyone is seeing the huge delay with generating the answer with the microphone permissions enabled. I've tried it on Chrome running in Linux and Windows and the delays are similarly long. I'm guessing it's a Chrome issue though.

thanks :)

richlegrand avatar Nov 12 '23 23:11 richlegrand

Hey @richlegrand

That is expected behavior. Chrome still allows non-mDNS if you do getUserMedia

Do you know if the mDNS issue was fixed. I can make a PR if that never got upstreamed!

Sean-Der avatar Sep 02 '24 02:09 Sean-Der