0
votes

for the past two days I've been trying to use a proxy with Selenium, that's not exactly the issue though. The issue is that the proxy is private meaning it needs authentication to use it (Username and Password) but I can't figure out how to do it.

I'm using a Firefox driver, with a profile like so:

    FirefoxProfile firefoxProfile = new FirefoxProfile();
    firefoxProfile.SetPreference("network.proxy.type", 1);
    firefoxProfile.SetPreference("network.proxy.http", "23.95.115.87");
    firefoxProfile.SetPreference("network.proxy.http_port", 80);
    var driver = new FirefoxDriver(firefoxProfile);
    driver.Navigate().GoToUrl("http://ipchicken.com"); 

I figured that it would ask me for the username and password (in a dialog box) yet nothing happens, it just navigates to the webpage, and displays my own IP. I can't find anything really on this, any help guys? Thank you so much.

1

1 Answers

0
votes

I am not an expert in Selenium but I can help you in making your proxy authentication free.

If you are on Windows, download something like CC-Proxy ( Its free for a single user) and add your proxy as a cascading proxy. This will create a local proxy server on your computer which won't require username/password. Then you can use the local proxy server in selenium.

If you are on Linux, you can use wine to run CC-Proxy or you can use tinyproxy or squid ( it is an overkill).

Comment if you face problem in setting up CC-Proxy or tinyproxy.