-1

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

Natarajan
  • 1
  • 1
  • Possible duplicates - * https://stackoverflow.com/questions/32837471/how-to-get-local-internal-ip-with-javascript
    * https://stackoverflow.com/questions/32837471/how-to-get-local-internal-ip-with-javascript * https://stackoverflow.com/questions/391979/how-to-get-clients-ip-address-using-javascript/32841164#32841164 * You might want to check - [https://jsfiddle.net/pallab8077/34n0bpqu/](https://jsfiddle.net/pallab8077/34n0bpqu/)
    – Pallab Gain Jul 26 '19 at 13:13

2 Answers2

1

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

Community
  • 1
  • 1
0

Try This: Code For Getting IP With JS

  • I am not getting output. As per this code, I am not getting alert. – Natarajan Jul 26 '19 at 07:19
  • in code sdp.sdp value is: "v=0 o=- 3050064591588134787 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=msid-semantic: WMS m=application 9 DTLS/SCTP 5000 c=IN IP4 0.0.0.0 a=ice-ufrag:80WQ a=ice-pwd:rTuipqP2ygCdE046QPA8qxAk a=ice-options:trickle a=fingerprint:sha-256 94:2D:05:49:3F:D0:F6:E7:B6:1E:6B:4D:B5:DC:9F:A7:9F:3E:0C:41:1A:E9:7E:87:D0:E5:7B:E1:8D:D0:76:1C a=setup:actpass a=mid:0 a=sctpmap:5000 webrtc-datachannel 1024" – Natarajan Jul 26 '19 at 07:19
  • Yeah. I did like that – Natarajan Jul 26 '19 at 08:33