So I am working on preventing ip leak through webrtc detection , but most of the solution I can find is disabling webrtc, or using an extension. But I'm avoiding to do that, is there a way I can intercept the webrtc detection and send back a fake ip address instead of my actual ip address?
*I've read that even if you use vpn or proxy, it can still detect your actual ip address.
Yoiu should check whether what you read is the truth.
With current versions of browsers, no local ip addresses will be exposed to Javascript, they're obfuscated as mdns hostnames like this:
candidate:0 1 UDP 2122187007 a809bdf8-19c0-4af1-bfdb-9d432d40ecd5.local 57583 typ host
(note that within the same local network, this can still be resolved)
If the peerconnection is using a STUN server, a public ip address may be gathered. A properly configured VPN will prevent that. A HTTP proxy being sold as a "VPN" may not. That is a defect in such products. See https://webrtchacks.com/so-your-vpn-is-leaking-because-of-webrtc/ for a lengthy rant on this.