rebrowser / rebrowser-patches

Collection of patches for puppeteer and playwright to avoid automation detection and leaks. Helps to avoid Cloudflare and DataDome CAPTCHA pages. Easy to patch/unpatch, can be enabled/disabled on demand.
https://rebrowser.net
285 stars 25 forks source link

Webrtc leak is giving away my real IP. How to prevent this. #42

Open CovertCode opened 1 week ago

CovertCode commented 1 week ago

Code:

 const browser = await puppeteer.launch({
        headless: true,
        args: [
            `--proxy-server=${proxyUrl}`,
            '--no-sandbox',
            '--disable-setuid-sandbox',
            '--disable-web-security',
            '--disable-site-isolation-trials',
            '--enable-features=NetworkService',
            '--allow-third-party-cookies',
            '--disable-blink-features=AutomationControlled',
            '--disable-dev-shm-usage',
            '--disable-gpu',
            '--disable-extensions',
            '--disable-background-networking',
            '--disable-background-timer-throttling',
            '--disable-backgrounding-occluded-windows',
            '--disable-renderer-backgrounding',
            '--disable-features=site-per-process',
            '--mute-audio',
            '--no-first-run',
            '--disable-infobars',
            '--disable-breakpad',
            '--disable-notifications',
            '--disable-web-security',
            '--disable-features=WebRTC-HW-Decoding,WebRTC-HW-Encoding,WebRTC-Screen-Capturing,WebRTC-Stun-Origin',
        ],
    });

I have this many args and still webrtc is leaking my real ip Is there any way to prevent webrtc leak?

nwebson commented 1 week ago

Try to add these args:

'--webrtc-ip-handling-policy=disable_non_proxied_udp',
'--force-webrtc-ip-handling-policy',