Skip to content

Proxy settings ignored when configuration programmatically #751

@MaxCherry

Description

@MaxCherry

Description of the problem:

When configurating i.e. chrome driver like the following:

WebDriverManager.chromedriver() .proxy("myproxy:3128") .setup();

underlying instances of io.github.bonigarcia.wdm.online.HttpClient and io.github.bonigarcia.wdm.online.Downloader are created without the expected proxy settings being set.

Call of setup() fails during WebDriverManager#getDriversFromXml with an UnknownHostException.

From my point of view,

httpClient = new HttpClient(config);
downloader = new Downloader(httpClient, config, this::postDownload);

instances should not be created in the constructor of WebDriverManager, but in the setup method. Otherwise, underlying implementation of Apache's HttpClient remains uninitialized regarding proxy settings.

This issue does not occur when using -Dwdm.proxy=myproxy:3128 or by calling System.setProperty("wdm.proxy", "proxy:3128") in the first place. Instances of httpClient and downloader are then initialized properly.

WebDriverManager version:
5.0.3

WebDriverManager call:
WebDriverManager.chromedriver() .proxy("myproxy:3128") .setup();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions