2

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?

Michal
  • 4,952
  • 8
  • 30
  • 63
  • 1
    It should be : `--proxy-server=188.134.1.20:63756`. Remove the `http=` – Seblor Jun 22 '18 at 07:25
  • Thank you but that will throw errors: `et::ERR_EMPTY_RESPONSE at https://www.whatismyip.com/` (for this server: `--proxy-server=200.107.253.130:41443`) or `net::ERR_PROXY_CONNECTION_FAILED at https://www.whatismyip.com/` (for this server: `--proxy-server=183.163.39.177:1080`) I also tried many others but without success. – Michal Jun 22 '18 at 07:30
  • That is a problem with your proxy, not puppeteer, I'm afraid – Seblor Jun 22 '18 at 07:32
  • Do you have any free proxy that would make it work? Just 1 URL? So that I can be sure that there is a problem with my proxies? I didn't have any problems with `node-crawler` using same proxies... – Michal Jun 22 '18 at 07:34
  • 2
    Free proxies are generaly not to be trusted. I suggest you to set up your own one, if you own a VPS or any server. – Seblor Jun 22 '18 at 07:35

1 Answers1

1

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}'],
Michal
  • 4,952
  • 8
  • 30
  • 63