briba
briba

Reputation: 2987

Set proxy credentials in ChromeDriver

I'm trying to use a proxy with credentials in ChromeDriver but I don't know how to do it.

Here is my code:

ChromeOptions      options = new ChromeOptions();
ProxyManager.Proxy proxy   = proxyManager.GetProxy;

// Configure proxy
Proxy seleniumProxy         = new Proxy();
seleniumProxy.HttpProxy     = proxy.Ip;
seleniumProxy.SslProxy      = proxy.Ip;
seleniumProxy.SocksUserName = proxy.Username;
seleniumProxy.SocksPassword = proxy.Password;

options.Proxy = seleniumProxy;

using (ChromeDriver driver = new ChromeDriver(AppDomain.CurrentDomain.BaseDirectory, options))
{
    // SOMETHING
}

But the program keeps asking me for the credentials (manually).

What am I doing wrong?

Upvotes: 1

Views: 2433

Answers (1)

user1111380
user1111380

Reputation: 551

It doesn't look like the selenium proxy object supports HTTP proxies with credentials. You configured SocksUsername/pass, which is only used for SOCKS proxies. See Documentation here

Upvotes: 1

Related Questions