Skip to content

Commit 679fdb8

Browse files
authored
[dotnet] have support proxies for Selenium Manager (#12100)
1 parent 5b40670 commit 679fdb8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

dotnet/src/webdriver/SeleniumManager.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ public static string DriverPath(DriverOptions options)
9898
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --browser-path \"{0}\"", browserBinary);
9999
}
100100

101+
if (options.Proxy != null)
102+
{
103+
if (options.Proxy.SslProxy != null) {
104+
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --proxy \"{0}\"", options.Proxy.SslProxy);
105+
} else if (options.Proxy.HttpProxy != null) {
106+
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --proxy \"{0}\"", options.Proxy.HttpProxy);
107+
}
108+
}
109+
101110
return RunCommand(binaryFullPath, argsBuilder.ToString());
102111
}
103112

0 commit comments

Comments
 (0)