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:
- The browser gathers candidates: possible addresses and ports where it could be reached.
- It asks a STUN server "what address do you see me as?" and records the answer as a public (server-reflexive) candidate.
- It also lists the addresses of its own network interfaces (host candidates), such as a LAN address or an IPv6 address.
- 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
- HTTP and SOCKS proxies only carry the traffic you route through them. A STUN request over UDP often bypasses an HTTP proxy completely, so the STUN server sees your real public IP.
- Browser-level VPN extensions typically proxy only page requests, not WebRTC traffic.
- Split tunnelling or a misconfigured VPN can leave the physical interface reachable, so the browser still gathers candidates from it.
- IPv6. If the VPN tunnels IPv4 only, an IPv6 address may appear as a host candidate and identify you.
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
- Connect through your proxy or VPN and note the exit IP, for example with the IP lookup.
- 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.
- If a public address appears that is not your exit IP, you have a leak. A
.localname 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:
- An extension that uses the browser's WebRTC IP handling policy API, such as Google's "WebRTC Network Limiting" extension, which can restrict WebRTC to the default route or block non-proxied UDP.
- On managed machines, the
WebRtcIPHandlingenterprise policy. Setting it todisable_non_proxied_udpforces WebRTC to use UDP only through a proxy that supports it, and otherwise TCP, which prevents direct leaks. On Linux this is a JSON file in the managed policy folder:
{
"WebRtcIPHandling": "disable_non_proxied_udp"
}
Brave exposes a similar choice in its privacy settings under the WebRTC IP handling policy.
VPN and system level
- Prefer a VPN client that captures all traffic, and enable its kill switch and IPv6 leak protection if available.
- If the VPN offers a WebRTC leak option, enable it, then verify with the test. Do not trust the label alone.
- For automation, many headless setups launch with a policy that disables WebRTC, or use a browser profile with WebRTC blocked.
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.