WebRTC doesn't use configured proxy, regardless of IP handling policy setting

(As a new user, I was limited in the number of links that could be in my post. Apologies for the awkward “links” throughout.)

Description of the issue:

When behind a proxy, Brave does not seem to honor its WebRTC IP handling policy setting correctly.

When attempting to make a WebRTC connection (tested through: browserleaks → webrtc, and https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/), if a proxy is specified (tested by command line flag and by system proxy settings; tested both http and socks5 proxies), Brave will not use the proxy for WebRTC, regardless of WebRTC IP handling policy setting (intended behavior specified here).

If the WebRTC IP handling policy is set to Default, Default public and private interfaces, or Default public interface only, then Brave behaves as it would if it were not behind a proxy.

If the WebRTC IP handling policy is set to Disable non-proxied UDP, then it fails to gather any candidates and WebRTC is effectively disabled.

FWIW, the socks5 proxy I want to use is on localhost and has TCP+UDP support.

Tested on Windows 11 and Ubuntu with the same result.

How can this issue be reproduced?

  1. Start a socks5 proxy client with TCP+UDP support on localhost → 3333
  2. Launch Brave with flag --proxy-server=socks5://localhost:3333
  3. Confirm socks5 proxy works by navigating to your favorite “what is my IP” site and verifying your IP address is that of your proxy server.
  4. Navigate to brave settings → Privacy and Security → WebRTC IP handling policy
  5. Set to “Disable non-proxied UDP”
  6. Navigate to browserleaks.com/webrtc
  7. Observe that no IP addresses are detected

Expected result:

browserleaks → webrtc should be able to detect your proxy server as your public IP.

Brave Version( check About Brave):

v 1.39.111

Additional Information:

Test can be repeated with WebRTC IP handling policy set to “Default public interface only”, and one’s real (non-proxied) IP address is found by browserleaks.com/webrtc, rather than the external IP of the socks proxy server.