I have a project that uses ChromeDriver and a proxy I pay for. There's no authentication on the proxy. It used to set the proxy just fine but now when I run it, if I check my public IP address it's still my address, not the proxy address. I'm not sure if Chrome changed something or what, but does anyone know how to get the proxy to work again?
string proxyAddress = "https://xxx.xx.xx.xxx:xxxx"; //the x's are just masking the actual ip address
ChromeDriverService cds = ChromeDriverService.CreateDefaultService();
ChromeOptions co = new ChromeOptions();
if (!String.IsNullOrWhiteSpace(proxyAddress))
{
co.Proxy = new Proxy(){
HttpProxy = proxyAddress,
Kind = ProxyKind.Manual,
IsAutoDetect = false
};
}
co.AddArgument("ignore-certificate-errors");
co.AddArguments("chrome.switches", "--disable-extensions");
cds.HideCommandPromptWindow = true;
ChromeDriver drv;
if (commandTimeout != null)
{
drv = new ChromeDriver(cds, co, (TimeSpan)commandTimeout);
}
else
{
drv = new ChromeDriver(cds, co);
}
I've also tried this, but then every site Chrome says "This Site Can't be reached" and has the error code: ERR_NO_SUPPORTED_PROXIES.
string proxyAddress = "https://xxx.xx.xx.xxx:xxxx"; //the x's are just masking the actual ip address
ChromeDriverService cds = ChromeDriverService.CreateDefaultService();
ChromeOptions co = new ChromeOptions();
if (!String.IsNullOrWhiteSpace(proxyAddress))
{
co.AddArgument(String.Format("--proxy-server={0}", proxyAddress));
}
co.AddArgument("ignore-certificate-errors");
co.AddArguments("chrome.switches", "--disable-extensions");
cds.HideCommandPromptWindow = true;
ChromeDriver drv;
if (commandTimeout != null)
{
drv = new ChromeDriver(cds, co, (TimeSpan)commandTimeout);
}
else
{
drv = new ChromeDriver(cds, co);
}