Currently, I need to use proxy with authentication, on selenium-webdriver on Firefox.
I successfully connect to Tor using :
var option = new Options();
option.headless()
option.setPreference('network.proxy.type', 1)
.setPreference('network.proxy.socks', '127.0.0.1')
.setPreference('network.proxy.socks_port', 9050)
.setPreference('network.proxy.socks_remote_dns', true)
.setPreference('network.proxy.socks_version', 5)
let driver = await new Builder()
.forBrowser(Browser.FIREFOX)
.setFirefoxOptions(option)
.build();
But I don't find how to pass username and password for other proxy.
I looked on Selenium's github, but nothing worked. This is the exemple on the file's comment but not working:
let capabilities = new Capabilities();
capabilities.setProxy(proxy.socks('username:pass@host:port'))
// for tor
capabilities.setProxy(proxy.socks('host:port'))
let driver = await new Builder()
.withCapabilities(capabilities)
.forBrowser(Browser.FIREFOX)
.setFirefoxOptions(option)
.build();
Please help me :(