简体   繁体   中英

How to get correct client IP address. client IP address coming as some random value while using Javascript RTCPeerConnection?

I am trying to get client IP address using javascript (WebRTC).But,I am getting some anonymous values on a few machines. Example:"04e6e16d-5ca8-4643-bccd-f870c84d4aed.local"

I am not sure, what went wrong and what address it is. Please guide us.

I am using the code from below source to get an IP address

https://gist.github.com/hectorguo/672844c319547498dcb569df583f959d

WebRTC hosts candidates will now be anonymized using random mDNS hostnames to prevent websites from diverting WebRTC to snoop on local IPv4 addresses. The behavior is gradually enabled for all Chrome users. It's also being implemented in Firefox.

Here are the corresponding tickets for Chromium and Firefox , and the current IETF draft for WebRTC mDNS candidates.

For now, during local development you can still revert to the former behavior by setting the flag to disabled at chrome://flags/#enable-webrtc-hide-local-ips-with-mdns

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM