问题
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