How to get private client IP address in Microsoft Edge browser using Javascript?

核能气质少年 提交于 2019-12-25 01:14:58

问题


I have tried using WebRTC to find private client IP address using Javascript by following the below link and I am successful in Chrome and Firefox but it didn't work in Microsoft Edge.

https://ourcodeworld.com/articles/read/257/how-to-get-the-client-ip-address-with-javascript-only

All the third solutions gives only public IP address. Tried the answer from the below link as well.

How to get client's IP address using JavaScript?

How to get private Client IP address in Microsoft Edge browser using Javascript?

Do we have any other alternate for WebRTC to get private IP address in Edge browser?


回答1:


According to Browser Compatibility section of RTCPeerConnection, CreateDataChannel is not supported in Edge, therefore it won't work in Edge.

Also it is not recommended to leverage the WebRTC to expose the private IP address because:

The addresses exposed in candidates gathered via ICE and made visibile to the application in RTCIceCandidate instances can reveal more information about the device and the user (e.g. location, local network topology) than the user might have expected in a non-WebRTC enabled browser. ...

Referring to Address of WebRTC Standard.



来源:https://stackoverflow.com/questions/59244292/how-to-get-private-client-ip-address-in-microsoft-edge-browser-using-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!