C#: Alow All Remote Connections

471 views
Skip to first unread message

Ivo Dachev

unread,
Jan 5, 2023, 5:34:09 AM1/5/23
to Selenium Users
Hi everyone!
I have been struggling with figuring out how to "allow all remote connections" with a proxy in ChromeDriver in C#.
 ======== START script =============ChromeDriverService service = ChromeDriverService.CreateDefaultService();service.WhitelistedIPAddresses = ""; // NOTE: The idea is to allow all remote connections. How to allow all IPs?service.Port = 9515;ChromeOptions options = new ChromeOptions();var proxy = new Proxy();
proxy.Kind = ProxyKind.Manual;
proxy.IsAutoDetect = false;
proxy.HttpProxy = proxyUrl;
proxy.SslProxy = proxyUrl;
options.Proxy = proxy;options.AddArgument("ignore-certificate-errors");IWebDriver driver = new ChromeDriver(service, options);
int waitTime = GetRandomWait2to5.getRandom2to5();driver.Url = "https://whatismyipaddress.com/"; //TEST
============ END script =========================See attached screenshot with "local connections allowed".Passing "chrodriver --whitelisted-ips=''" in CMD works and says "all remote connections allowed".Thanks for the input. (edited) 
selenium-chromedriver-only_local_allowed.png

Jessica Wikholm

unread,
Feb 5, 2023, 1:21:42 AM2/5/23
to Selenium Users
Just under the "Only local connections are allowed" there is a URL listed ChromeDriver - WebDriver for Chrome - Security Considerations (chromium.org)

That URL explains "If you need to connect to it from a remote host, use --allowed-ips switch on the command line to specify a list of IP addresses that are allowed to connect to ChromeDriver."

Looks like you are passing an empty string: service.WhitelistedIPAddresses = "";

Also would not recommend ALL IP Addresses as that could allow anyone to potentially access it. Would instead recommend only using the IP Addresses of the computers that will be accessing it remotely.
Reply all
Reply to author
Forward
0 new messages