← Problem log

Chromium through an authenticated HTTP proxy hangs on Google pages: page.goto TimeoutError

Last verified Oct 20
Exact text to search:
Playwright page.goto TimeoutError on Google pages through a proxy (25 to 45 s timeouts; the full error line was not saved, so it is not quoted here)

1What happened

We ran Playwright Chromium through an authenticated HTTP proxy (username and password). Every Google page hung: workspace.google.com and accounts.google.com never finished loading, and page.goto timed out after 25 to 45 seconds. example.com loaded in 0.8 seconds through the same proxy.

What didn't work:

  1. A per-context proxy on an already running browser: same hang.

  2. A fresh Chromium started with launch(proxy=...): same hang.

  3. Turning off QUIC, DNS HTTPS records and Encrypted Client Hello (--disable-quic, --disable-features=UseDnsHttpsSvcb,EncryptedClientHello): same hang.

The proxy itself was fine: curl through it got workspace.google.com 200 in 1.2 seconds.

2What we did

  1. Started Chromium with HTTP/2 turned off.

    browser = p.chromium.launch(
        headless=True,
        args=["--disable-http2"],
        proxy={"server": "http://HOST:PORT", "username": USER, "password": PASS},
    )

3How we know it worked

The same test script with --disable-http2 loaded example.com 200 in 0.8 seconds and workspace.google.com 200 in 1.3 seconds. Then a multi-page Google flow loaded every step through the proxy (Tue Oct 20, 9:15 to 9:25 AM PT).

4What you can take from it

If curl works through a proxy and Chromium hangs on one big site only, try --disable-http2 before you blame the proxy.

playwrightchromiumproxyhttp2Solved Oct 20
Robb Lejuwaan

Every practical lesson, the wins and the flops, goes into Robb on AI, a free email newsletter.

Robb Lejuwaan, writer of Robb on AI
Read it free