Skip to content
$ learn webrtc-leak

What is a WebRTC leak and how to stop it

How WebRTC exposes your real IP, how to test it, and how to close the leak.

A WebRTC leak happens when a web page uses your browser's real-time communication features to discover and read your real IP address, even though your web traffic goes through a VPN or proxy. It is one of the most common reasons a "hidden" connection turns out to be visible, and it affects users of proxies for scraping, privacy and geo-testing alike.

What WebRTC is and why it exposes addresses

WebRTC is the browser technology behind video calls, screen sharing and peer-to-peer data transfer. For two browsers to talk directly, each must find a network path to the other. The process is called ICE (Interactive Connectivity Establishment) and works like this:

  1. The browser gathers candidates: possible addresses and ports where it could be reached.
  2. It asks a STUN server "what address do you see me as?" and records the answer as a public (server-reflexive) candidate.
  3. It also lists the addresses of its own network interfaces (host candidates), such as a LAN address or an IPv6 address.
  4. The candidates are exchanged with the other side, and the best working pair is used.

The key detail is that any web page can start this process with a few lines of JavaScript, without a camera or microphone permission, and read the candidate list. The STUN request is sent over UDP directly from your machine, so it does not necessarily follow the HTTP proxy or the browser's proxy settings.

Why VPN and proxy users leak

A full-device VPN that captures all traffic, including UDP, usually prevents the public IP leak, because the STUN query itself goes out through the tunnel. Local network addresses can still show up as host candidates.

What modern browsers changed

Browser vendors have reduced the exposure of local addresses. Chromium-based browsers and Firefox commonly replace the local IPv4 address in host candidates with a random mDNS name (something ending in .local) unless the page has been granted camera or microphone access. This hides your LAN address, but it does not stop the public address from being revealed through a STUN server when UDP bypasses your proxy. Exact behavior differs by browser, version and platform, so always test your own setup instead of assuming.

How to test for a WebRTC leak

  1. Connect through your proxy or VPN and note the exit IP, for example with the IP lookup.
  2. Open the WebRTC leak test in the same browser. It runs entirely in your browser, asks a STUN server for your candidates, and compares what it finds with the IP our server sees.
  3. If a public address appears that is not your exit IP, you have a leak. A .local name or a private range address (such as 192.168.x.x) is a local candidate, not a public leak.

Test again after every change. Repeat with a private window and with your extensions disabled, since extensions can alter the result.

How to stop WebRTC leaks

Firefox

Open about:config and review these preferences. Names and defaults can change between versions.

media.peerconnection.enabled = false             # disables WebRTC entirely
media.peerconnection.ice.default_address_only = true
media.peerconnection.ice.no_host = true         # do not offer host candidates

Setting media.peerconnection.enabled to false is the strongest option, but it breaks video calling sites. The ICE settings are a gentler middle path, although they may not stop every case.

Chrome, Edge and other Chromium browsers

There is no simple switch in the settings page. Two options exist:

{
  "WebRtcIPHandling": "disable_non_proxied_udp"
}

Brave exposes a similar choice in its privacy settings under the WebRTC IP handling policy.

VPN and system level

Leak protection has trade-offs

Disabling WebRTC can break video conferencing, some voice chat and some peer-to-peer file transfer. A pragmatic approach is a separate browser profile with WebRTC restricted for sensitive work, and a normal profile for meetings.

WebRTC is only one of many signals a site can use to recognise you. Canvas, fonts, screen size and more can identify a browser even after IP leaks are fixed; see what your browser reveals in the browser fingerprint test, and read about the headers a proxy adds in proxy anonymity levels.

FAQ

Does an HTTPS proxy stop WebRTC leaks? No. The proxy handles HTTP(S) requests; WebRTC's UDP traffic is separate.

Is a leak the same as a fingerprint? No. A leak reveals an IP address. A fingerprint combines many browser traits into an identifier.

Can a website see my real IP without WebRTC? Yes, through other channels such as a DNS leak, IPv6 requests that bypass the tunnel, or logging in with an account tied to you. WebRTC is just an easy one to check.

Published and last updated 2026-12-02