meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.23k stars 2.48k forks source link

Couldn't resolve mDNS address #1692

Closed cosysun closed 5 years ago

cosysun commented 5 years ago

when chorme mdns enable, candidate include *.local, but janus parse candidate failed, error info: getaddrinfo code:Name or service not known. can you tell me how to fix the issue, thank you.

lminiero commented 5 years ago

mDNS candidates only work in the same LAN, or to be more precise, the same LAN segment. Outside of that they can't be resolved. Janus won't be able to resolve a mDNS candidate of a remote user. Besides, it will also fail if the network/users don't support mDNS. Closing.

cosysun commented 5 years ago

ok, but if so, the webrtc can't connect. do you have the best idea to slove the issue! thank you!

zoolyka commented 5 years ago

I'm facing the same issue.

Janus is running on a server with an own public IP address. Chrome started to use this mDNS anonymization by default, even for remote (outside of LAN) WebRTC services.

It can be turned off here: chrome://flags/#enable-webrtc-hide-local-ips-with-mdns

But that is obviously not a solution to warn all visitors to disable this chrome flag if you want to use our site.

xmedia-systems commented 5 years ago

We can confirm it too: even though failing to resolve mDNS candidates shouldn't be fatal, newer versions of Chrome fail to connect very often with #enable-webrtc-hide-local-ips-with-mdns set to "on" while no problems when "off"

kennethjiang commented 5 years ago

Same problem here. the server is a in the cloud with a public IP.

And it doesn't seem to be a problem with other packages that are built with Google's webrtc stack, such as https://github.com/mpromonet/webrtc-streamer

cordmata commented 5 years ago

We were just hit by this as well. Disabling chrome://flags/#enable-webrtc-hide-local-ips-with-mdns worked, but interested in suggestions for a long term solution.

kennethjiang commented 5 years ago

Can we reopen this issue? There are reasons to believe the problem is in Janus because the other packages built with Google's WebRTC stack doesn't suffer from the same problem.

lminiero commented 5 years ago

There's no issue to solve. We support mDNS, if they're in the same LAN segment. Outside of that you need other candidates, and prflx candidates will do it if Janus is reachable. If connectivity is not working for you, then your setup or configuration is wrong.

zoolyka commented 5 years ago

I just followed all instructions for the video streaming demo, did not involved any own code or idea. It is sure that this issue is not caused by the janus.js api client? Thank you.

fintros commented 5 years ago

I just fix the same issue on my site by installing zeroconf stuff on same server with janus-gateway. for example on ubuntu/debian: sudo apt install avahi-daemon avahi-discover libnss-mdns

wmajerski commented 5 years ago

The fix suggested by @fintros did not work for me.

@lminiero : could you please suggest how to add other ICE candidates? One thing I noticed in my application that uses videoroom plugin is that I'm able to connect despite the mDNS anonymization when I'm a publisher (e.g. I initialize the WebRTC connection actively). Subscribers/listeners who are responding to Janus'es WebRTC offers are not able to connect (speaking more precisely, they have only one ICE candidate availalbe that is refused by Janus).

What is also very confusing is that when I open a tab as a publisher and initialize the connection and within the same Chrome browser I open another tab as a subscriber/listener then the problem doesn't occur - I'm able to join as a subscriber and I have more than one ICE candidates available.

Could you please advise on that?

Thank you for your amazing work!

lminiero commented 5 years ago

I answered on this about a hundred times on the group... short answer: prflx will get it working if Janus is reachable. Please search there for more info.

lminiero commented 5 years ago

And you do need a recent version of libnice: anything older that 0.1.15 will not work most of the times.

lbhnrg2021 commented 5 years ago

upgrade libnice 0.1.16 solve!!!!!

oscarvadillog commented 5 years ago

Yep, libnice >= 0.1.15 is recommended 👍

oscarvadillog commented 5 years ago

https://github.com/meetecho/janus-gateway/pull/1835

heloufir commented 4 years ago

I have same issue here, I installed libnice-dev 0.1.16 but always same issue

yusukem99 commented 3 years ago

I have same issue here, I installed libnice-dev 0.1.16 but always same issue

I had same problem, i installed libnice 0.1.18, make new janus binnary but janus says libnice version outdated: 0.1.14 installed, at least 0.1.16 recommended. in my case, after cloning janus-gateway to new folder, this warnig disappeared and everything worked fine