How to Stop WebRTC Leaks in Your Browser
What is a WebRTC leak?
WebRTC lets a web page make voice and video calls or share files directly with another device. To set up that direct connection, the browser looks up the network addresses it can be reached on and can hand them to the page.
That is where a leak comes from. A website normally sees one address: your VPN server’s, while the VPN is on. If WebRTC hands the page a different public address, such as the one your internet provider gave you, the website can learn your real IP address even though the VPN is connected.
There are two kinds of address in play, and it helps to keep them apart:
- Your public IP address is the one the internet sees. This is the one a VPN is meant to replace, and the one the test below looks for.
- Your local IP address is the one your router gives your device inside your home network. It does not show where you are, but it can help a site tell your device apart from others.
Some of the browser settings below only hide the local address. They are useful, but they are not the same as stopping your public address from leaking.
How do I check for a WebRTC leak?
Run the test below with your VPN connected. It asks your browser for the public addresses WebRTC would share and compares them with the address this site sees. Our IP address checker shows the address websites see, with its location and network.
Does my browser leak my IP address through WebRTC?
Turning WebRTC off can break video calls in some apps.
Addresses ending in .local are hidden by your browser. That is normal.
Run it again after you change a setting in your browser, and after a browser update. A result of “No public address found” usually means WebRTC is switched off or blocked in that browser. A result of “Different kinds of address” means WebRTC found an IPv6 address while websites see an IPv4 address, or the other way around, and the test can’t compare the two. If you use a VPN, turn it off and run the test again: if WebRTC shows the same address again, it comes from your own internet connection, and with the VPN on it may be a leak.
How do I turn off WebRTC in Firefox?
Firefox has a setting that switches WebRTC off completely. It sits in about
- Type about
in the address bar and press Enter. If Firefox shows a warning about changing advanced settings, read it and choose to continue. - In the search box at the top, type media.peerconnection.enabled. One setting with that name appears.
- If its value is true, double-click it, or press the toggle button at the end of the row. The value changes to false.
- Reload this page and run the WebRTC test above. With WebRTC switched off, the test should no longer find a public address.
Steps as described by Mozilla, in Firefox's own source code (github.com/mozilla-firefox/firefox/blob/main/modules/libpref/init/StaticPrefList.yaml), read on .
Mozilla’s code notes that this setting also turns on camera and microphone access for websites. With it set to false, video calls and other camera or microphone features in websites can stop working in Firefox. To undo the change, search for the same setting again and set it back to true.
Can I limit WebRTC in Brave?
Yes. Brave’s help center lists a setting called WebRTC IP Handling Policy among its privacy settings. You find it under Settings, then Privacy and Security. Brave describes it as an advanced option that most people do not need to change.
The setting has four options:
- Default
- Default Public And Private Interfaces
- Default Public Interface Only
- Disable Non-Proxied UDP
Brave’s help article explains what each option does. Whichever you pick, run the test above again to see what your browser shares.
Steps as described by the Brave Help Center (support.brave.app/hc/en-us/articles/360017989132), read on .
What about Chrome, Edge and Safari?
The pages cited below describe no WebRTC switch in these three browsers’ regular settings: Google and Microsoft document a policy for administrators, and the WebKit team describes Safari’s default behavior. Browser extensions that say they block or limit WebRTC exist, but we do not recommend any particular one here. If you install one, run the test above to see what it changes.
Chrome
Google’s documentation describes a WebRTC setting only for administrators who manage Chrome for an organization, through a policy called WebRtcIPHandling. Google says the policy restricts which IP addresses and network connections WebRTC uses. On a work or school computer, your IT team may have set it already. It is not a setting you change on the regular Chrome settings page.
As described by Google, in the Chrome policy definitions (chromium.googlesource.com/chromium/src/+/main/components/policy/resources/templates/policy_definitions/WebRtc/WebRtcIPHandling.yaml), read on .
Edge
Microsoft documents a similar policy for administrators, called WebRtcLocalhostIpHandling, for Edge on Windows and Mac. It is not supported in Edge on Android or iOS. Microsoft says two of its four settings stop WebRTC from exposing your local IP address. The policy is about the local address, not the public address a VPN hides, so it does not replace the test above.
As described by Microsoft Learn (learn.microsoft.com/en-us/deployedge/microsoft-edge-policies/webrtclocalhostiphandling), read on .
Safari
Apple’s WebKit team, which makes the engine inside Safari, wrote in 2017 that Safari does not give a website your device’s local IP address through WebRTC unless you have let that site use your camera or microphone. Safari has changed many times since then, so check your own browser with the test above.
The same post mentions an option for web developers, Disable ICE Candidate Restrictions, in Safari’s Develop menu. It removes that protection. If you see it, leave it switched off.
As described by the WebKit team (webkit.org/blog/7763/a-closer-look-into-webrtc/), read on .
Will a VPN stop WebRTC leaks?
Not always. A VPN changes the address websites see for your normal traffic, but WebRTC works inside the browser, and how each VPN app deals with it differs from one app to the next.
The way to know is to test your own setup: connect your VPN, open the test above in each browser you use, and run it. If it finds a public address that is different from the one websites see, change the browser setting described above for that browser, or ask your VPN provider how its app handles WebRTC.
FAQ
Does turning off WebRTC break video calls?
It can. Mozilla’s code says the Firefox setting above also controls camera and microphone access for websites, so video calls in websites may stop working in Firefox after you switch it off. You can switch it back on at any time, or use a different browser for calls.
Do I need to worry about WebRTC without a VPN?
Without a VPN, websites already see your real public IP address, so WebRTC has nothing extra to reveal about it. The local address can still be shared in some browsers.
Can a website see my local IP address through WebRTC?
In some browsers, yes, unless the browser hides it. The local address does not show where you are, but it can help a site recognize your device. Microsoft says two settings of the Edge policy above stop WebRTC from exposing it.
Should I check again after a browser update?
Yes. Running the test above takes a few seconds, and it is the only way to see what your browser shares after an update or a new extension.
Is a WebRTC leak the same as a DNS leak?
No. A WebRTC leak shows a website your IP address through the browser. A DNS leak sends the names of the sites you visit to your internet provider’s servers instead of through the VPN. Both are worth checking, and they need different fixes.