/webrtc-ip

An IP address scanner using WebRTC.

Primary LanguageJavaScript

webrtc-ip

A scanner that will scan and identify your public and local IP addresses. This scanner also has the ability to detect anonymized addresses, generated by an experimental feature of Chromium.

Usage

Visit https://ip.neerajaggarwal.com in your browser to see a working demonstration.

Browser Support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
No Yes Yes No Yes

Anonymized IP

An experimental feature of Chromium is to automatically anonymize local IPs exposed by WebRTC. To be able to retrieve the local IP address, you must disable this feature.

Go to chrome://flags/#enable-webrtc-hide-local-ips-with-mdns in your Chrome browser to disable.

Screen Shot 2019-10-07 at 5 38 47 PM

How It Works

WebRTC will attempt to open a SDP offer. If the offer was successful, it will parse the returned RTCSessionDescription, which contains the configuration of the connection.

There is also a listener for when there is an icecandidate event within the connection instance, which will provide the SDP of the ICE candidate.

Inspiration

Inspired from projects by diafygi and natevw.