Yoda
Yoda

Reputation: 99

Playwright HTTP proxy Authentication issue

I am using playwright java lib 1.44 version. I am setting proxy url, username & password in Proxy object provided in launch options. But some how apache traffic proxy server is not able to authenticate it. Its debug logs does not show username/password in request headers which were meant for proxy server.

I am using following code to launch browser..

launchOptions.setProxy(new Proxy("http://proxy:8080/"));
launchOptions.proxy.setUsername("abcUser");
launchOptions.proxy.setPassword("123456");
Browser browser = playwright.chromium().launch(launchOptions);

Question:

  1. In which request header playwright sets the authentication information ? header name ?

  2. Is there anyway to view this header information?

  3. Does playwright converts this proxy info internally into "Proxy-Authorization" : encoded("abcUser:123456") ?

  4. shall i set it as follows? Is this required?

String proxyEncoding = Base64Encoder.encode ("abcUser:123456"); page.setExtraHTTPHeaders(Map.of("Proxy-Authorization", proxyEncoding));

Upvotes: 0

Views: 226

Answers (0)

Related Questions