I'm trying to use a headless Chrome browser through a proxy that requires authentication:
require "selenium-webdriver"
options = Selenium::WebDriver::Chrome::Options.new(
args: ["headless", "proxy-server=http://#{host}:#{port}"]
)
driver = Selenium::WebDriver.for(:chrome, options: options)
This works when authentication is not needed, but now I need to use it with authentiation.
In "List of Chromium Command Line Switches" I didn't find how to pass username and password correctly. In Google I found this option, but it doesn’t work:
options = Selenium::WebDriver::Chrome::Options.new(
args: ["headless", "proxy-server=http://#{username}:#{password}@#{host}:#{port}"]
)
How do I use headless-chrome with a proxy authentication?