Launch chrome with proxy
Hi. Is it possible to launch the browser with a proxy at all? The only way I can figure out is to launch, connect to the browser using puppeteer, and then use puppeteer-page-proxy to change the proxy for that page. Thanks
You can use the proxy command-line flags
const {launch} = require('chrome-launcher')
launch({chromeFlags: ['--proxy-server=<scheme>=<uri>[:<port>]']})
(node:22552) UnhandledPromiseRejectionWarning: Error: net::ERR_NO_SUPPORTED_PROXIES at https://www.google.com
You can use the proxy command-line flags
const {launch} = require('chrome-launcher') launch({chromeFlags: ['--proxy-server=<scheme>=<uri>[:<port>]']})
Thanks for the reply. When I launch chrome with these chromeFlags and try to load a page, an error occurs: (node:22552) UnhandledPromiseRejectionWarning: Error: net::ERR_NO_SUPPORTED_PROXIES at https://www.google.com
The line which launches chrome is as follows: chrome[i] = await chromeLauncher.launch({chromeFlags: ['--proxy-server="52.71.28.74:3112"']});
I also need to authenticate the proxy too but I'm not sure how to do that.
Thanks
@jackwicklow1 yes you will need to replace the components of --proxy-server=<scheme>=<uri>[:<port>] with scheme, uri, and port as necessary according to the linked Chromium documentation.
I also need to authenticate the proxy too but I'm not sure how to do that.
Looks like you can't but there are workarounds.