Ad

Puppeteer Not Chaning My IP

Basically, any proxy server (for example from this website https://www.socks-proxy.net/) will not change my IP

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    args: ['--proxy-server=http=188.134.1.20:63756'],
    ignoreHTTPSErrors: true,
    headless: true
  })
  const page = await browser.newPage()
  await page.goto('https://www.purevpn.com/what-is-my-ip', { waitUntil: 'networkidle0' })
  // I can see my native IP on a screenshot
  await page.screenshot({ path: 'example.png' })

  await browser.close()
})()

What am I missing?

Ad

Answer

There was a problem with my VPN. It did not allow to connect using https. However, the goto page https://www.purevpn.com/what-is-my-ip uses secured connection.

So the solution is change http to https:

- args: ['--proxy-server=http=188.134.1.20:63756'],`
+ args: ['--proxy-server=https=188.134.1.20:63756'],

And use a VPN that supports secured connection:

- args: ['--proxy-server=https=188.134.1.20:63756'],
+ args: ['--proxy-server=https={BETTER_VPN:PORT}'],
Ad
source: stackoverflow.com
Ad