Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short mdns resolve timeout causing WebRTC connection failure on local network #77

Open
yiufaicheng-iginno opened this issue May 10, 2023 · 0 comments

Comments

@yiufaicheng-iginno
Copy link

Hi,

I am facing a problem where the frontend, using JavaScript, connects to a Python aiortc WebRTC server. The connection works fine with a STUN server, but fails when no internet access is provided. The issue is similar to the one described in the following GitHub issue: Webcam example without Internet connection.

Upon investigation, I discovered that the RtcIceCandidate is in mdns format and uses mdns to resolve the hostname. The ice.py code snippet below illustrates this:

if mdns.is_mdns_hostname(remote_candidate.host):
    mdns_protocol = await get_or_create_mdns_protocol(self)
    remote_addr = await mdns_protocol.resolve(remote_candidate.host)
    if remote_addr is None:

The resolve timeout in the mdns protocol uses a default value of one second. However, on my computer, I have several network adapters (at least 4, including virtual networks such as VirtualBox and VMware) that can cause the resolution to take more than one second. I solved the problem by changing the timeout to 5 seconds.

I would like to know if there is a way to customize the resolve timeout in aioice so that it can be based on my situation to use the appropriate timeout.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant