saucelabs / forwarder

Forwarder is a production-ready, fast MITM proxy with PAC support. It's suitable for debugging, intercepting and manipulating HTTP traffic. It's used as a core component of Sauce Labs Sauce Connect Proxy.
https://forwarder-proxy.io
Mozilla Public License 2.0
202 stars 13 forks source link

Selenium specific use case #622

Open titusfortner opened 6 months ago

titusfortner commented 6 months ago

The Selenium drivers do not currently accept credentials when using a proxy to route communication between the internet and the browser.

https://github.com/mozilla/geckodriver/issues/1872 https://bugs.chromium.org/p/chromedriver/issues/detail?id=4118

This application may be an easy way for Selenium users that are behind an authenticated proxy to create a MITM instance and put Forwarder information in the Selenium Options class for the driver, and then configure Forwarder with the authentication credentials needed by the proxy on the system. If this can be documented or explained or if there is a tutorial, then we can publicize it and link to it from the Selenium documentation.

Choraden commented 1 month ago

In order to configure forwarder that way user needs to set up upstream proxy see --proxy flag The basic authentication username and password can be specified in the host string e.g. user:pass@authenticated-proxy:port.

Optionally, if they need to inject authentication credentials/modify HTTP requests that are encrypted, they need to:

Generally forwarder's documentation has all the needed ingredients to make such explanation. However, I believe Selenium documentation is a place where it can be got together for its specific use case.

titusfortner commented 1 month ago

@diemol what do you think of this idea? Is it worth documenting a demo of it?

diemol commented 1 month ago

Could be a good idea. Maybe in the test practices section?

titusfortner commented 1 month ago

I don't know how to create an environment where an authenticated driver proxy is required, so we can demo not working vs working.