-
Notifications
You must be signed in to change notification settings - Fork 575
Support for authenticated proxies #29
Comments
Requested by Tim on Slack to post here regarding a use case for HTTP Basic Authentication - the popup that appears for credential login when htpasswd configured by a web server like Apache or NGINX. Currently, I believe Selenium 3.4 has a working beta on it. Would be great if this was supported. |
@adieuadieu do you have an example of how this works with authenticated proxies? I'm setting the --proxy-server chrome flag (ip:port) and then adding Authorization and Proxy-Authorization headers (base64(user:pass)) using the setExtraHTTPHeaders. Has this functionality been confirmed? |
Should be solved with #325 (v1.4.0) |
For anyone still looking for a way to do so, take a look at: https://blog.apify.com/how-to-make-headless-chrome-and-puppeteer-use-a-proxy-server-with-authentication-249a21a79212. or in short: const chromeLauncher = require('chrome-launcher');
const { Chromeless } = require('chromeless')
const proxyChain = require('proxy-chain');
async function run() {
const oldProxyUrl = 'http://USER:PASS@PROXY_HOST_HERE:PROXY_PORT_HERE';
const newProxyUrl = await proxyChain.anonymizeProxy(oldProxyUrl);
const chrome = await chromeLauncher.launch({
port: 9222,
chromeFlags: [
'--window-size=1200,800',
'--disable-gpu',
'--headless',
`--proxy-server=${newProxyUrl}`
]
});
const chromeless = new Chromeless({
launchChrome: false
});
const screenshot = await chromeless
.goto('https://google.com')
.type('chromeless', 'input[name="q"]')
.press(13)
.wait('#searchResultsTbl')
.screenshot()
console.log(screenshot) // prints local file path or S3 url
await chromeless.end()
}
run().catch(console.error.bind(console)) |
Does this support authenticated proxies? Similar to how nightmarejs has the
.authentication
methodThe text was updated successfully, but these errors were encountered: