1

I am attempting to use a proxy within my Node.js / Puppeteer application and receiving errors.

If I remove the proxy code, the application runs as intended.

const browser = await puppeteer.launch({args: ['--proxy-server=socks5://127.0.0.1:9050'], headless: false});

I expect the application to run as usual, but with a different IP.

Error received: ERR_PROXY_CONNECTION_FAILED

FragEden
  • 43
  • 1
  • 6
  • I have written step-by-step instructions for configuring proxy with Puppeteer. https://dev.to/gajus/using-http-proxy-with-puppeteer-di1 – Gajus Feb 10 '20 at 00:30

1 Answers1

5

Either your proxy is not working or puppeteer is rejecting it because it is most likely using a self-signed cert. To fix a cert issue add the following args.

args: [
    '--proxy-server=socks5://127.0.0.1:9050'
    '--ignore-certificate-errors',
    '--ignore-certificate-errors-spki-list '
]

See: https://github.com/GoogleChrome/puppeteer/issues/1159

Michael Hobbs
  • 1,663
  • 1
  • 15
  • 26