-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rust] Support for web proxy in Selenium Manager #11575
Conversation
9fb7496
to
b780193
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this has been discussed elsewhere, but if a user is behind a proxy, do we need to invoke Selenium Manager in the bindings with the --proxy
and --timeout
flags? (Seems there is a default value for timeout, so the flag might not be needed).
If the bindings do need to invoke Selenium Manager with those flags, how will the bindings know if there is a proxy set? Should they detect it? Wouldn't it be easier if Selenium Manager detects that it is being a proxy so we do not write the same code across bindings?
The Regarding proxy, as I imagine it (or, for example, in the way in which the proxy setup works in WebDrivermanager), the user is the one who configures the proxy URL. I don't know how to make this discovery automatic. But there are some cases where that is not possible, for the best of my knowledge, for example, for authenticated web proxies (e.g., http://user:pass@my-proxy.net). Therefore, IMO the bindings should provide a way to configure the proxy URL, and when that info is specified by the user, the bindings invoke Selenium Manager using |
Right, authenticated proxies are tricky. I am not sure how we can set an authenticated proxy in the bindings these days. Probably we need to review that, and if a proxy is set, then pass it along? |
I think that having the flag |
Yes, we should have the flag to set the proxy, I was just thinking if there is a way to centralize most of the code in Selenium Manager. Bindings have a way to set a proxy for the browser, not the HTTP connection, which is why I wonder how each binding is doing that bit. @titusfortner, do you know? |
b780193
to
65d6c06
Compare
I think we can/(need to?) use the same info that gets passed in to the driver with the Options instance, and we're already going to be parsing Options instance. |
Yes, I think the optimal choice is to reuse the proxy specified by the user as options (i.e., For instance, in the Java bindings, when the user does the following:
... internally, the Java bindings invoke Selenium Manager with And when the proxy is secure:
... the call to Selenium Manager should be |
This generally seems correct. I'm guessing we prefer ssl over http. Actually, I'm not a proxy person. Would http even work for downloading drivers since everything redirects to https these days? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @bonigarcia!
Description
This PR implements a couple of new flags for Selenium Manager:
--proxy <PROXY>
: HTTP(S) proxy for network connection (e.g., https://myproxy.net:8080)--timeout <TIMEOUT>
: Timeout for network requests (in seconds). This timeout is applied from when the request starts connecting until the response body has finished [default: 120 seconds]Motivation and Context
This PR is part of the development of Selenium Manager M3 (requested in #11294).
Types of changes
Checklist