privacy / security / vpn
WebRTC and WebSocket leaks: how your browser can give away your real IP
A VPN or proxy hides your address from the sites you visit, unless the browser hands it over through another channel. Here is how WebRTC and WebSocket leaks work and how to close them.

On this page
A VPN or proxy works by making every site see its address instead of yours. Two browser features can break that promise: WebRTC, which can list your real addresses, and WebSocket connections that skip the proxy altogether.
You can check your own browser with the NasNet WebRTC and WebSocket leak test.
What is a WebRTC leak?
WebRTC lets browsers make voice and video calls directly with each other. To do that, a page can ask the browser for every address it could be reached at, and the browser answers without asking you.
Behind a VPN or proxy, that list can include your real public address or your address on the local network. Any site can collect it with a few lines of script.
What is a WebSocket leak?
A WebSocket is a long-lived connection that chat, live dashboards and games use. Some proxy setups, browser extensions in particular, route ordinary page requests but let WebSocket connections go out directly.
When that happens, the site sees your real address on the WebSocket even though the page itself came through the proxy.
How the test works
First the test notes the address your page request came from. Then the browser opens a WebSocket to our server and reports the address that one arrived from. Last, it asks public STUN servers from Google and Cloudflare what its public address is, and lists every address WebRTC offers.
Any public address on a different network from the first one is a leak. Addresses are looked up on ipleak.net to show their provider and country. NasNet stores none of it.
How to fix it
Browsers do not all offer the same controls. Use whichever applies to yours.
- Firefox: open about:config and set media.peerconnection.enabled to false. This turns WebRTC off entirely.
- Chrome, Edge and Brave: install uBlock Origin and turn on "Prevent WebRTC from leaking local IP addresses" in its settings. Brave also has a WebRTC IP handling policy under Privacy and security.
- Safari keeps local addresses hidden by default. Leave Develop › WebRTC settings at their defaults.
- Use a VPN app that tunnels the whole device rather than a browser extension, which only sees the traffic the browser hands it.
- Better still, tunnel at the router, as NasNet Panel does, so every connection from every device leaves through the same path.
After each change, open a new tab and run the leak test again.