I'm trying to use a proxy for Chromium on Windows:
BrowserType.LaunchOptions launchOptions = new BrowserType.LaunchOptions();
launchOptions.setProxy(new Proxy("localhost:8888"));
Browser browser = Playwright.create().chromium().launch(launchOptions);
In the settings I see that the proxy has been set properly, but the option Use proxyserver
is set to false
.
How to change that?
Try the --proxy-server
command line switch:
launchOptions.setArgs(List.of("--proxy-server=http://localhost:8888"))
(via)