Back to Blog
tutorialsDecember 20, 20245 min read

Detecting and Preventing WebRTC Leaks

WebRTC can expose your real IP even when using a proxy. Learn how to detect and fix these leaks.

What is a WebRTC Leak?

WebRTC (Web Real-Time Communication) is a browser technology that enables peer-to-peer connections for video, audio, and data sharing. Unfortunately, it can bypass proxy settings and expose your real IP address.

How WebRTC Leaks Happen

  • Browser requests STUN server for ICE candidates
  • STUN server returns your public IP
  • This IP is visible to websites via JavaScript
  • Detection Methods

    Browser Console Test

    // Check for WebRTC leaks

    const pc = new RTCPeerConnection({

    iceServers: [{ urls: 'stun:stun.l.google.com:19302' }]

    });

    pc.createDataChannel('');

    pc.createOffer().then(o => pc.setLocalDescription(o));

    pc.onicecandidate = e => {

    if (e.candidate) console.log(e.candidate.candidate);

    };

    Using Our IP Score Tool

    Our IP Anonymity Score tool automatically checks for WebRTC leaks and displays any detected local or public IPs.

    Prevention Strategies

    Browser Extensions

  • uBlock Origin (WebRTC leak prevention setting)
  • WebRTC Leak Shield
  • Privacy Badger
  • Browser Settings

    **Firefox**: Set `media.peerconnection.enabled` to `false` in about:config

    **Chrome**: Use browser extension or run with `--disable-webrtc` flag

    Conclusion

    Always test for WebRTC leaks when using proxies for privacy. Our tools can help you verify your anonymity level.

    Related Tools