- Notifications
You must be signed in to change notification settings - Fork1k
Open
Description
Version
1.52.0
Steps to reproduce
importasyncioimportjsonfromplaywright.async_apiimportasync_playwrightTEST_URL="https://api.ipify.org?format=json"PROXY= {"server":"http://proxy_url:proxy_port","username":"username","password":"password", }asyncdeffetch_ip(context):page=awaitcontext.new_page()awaitpage.goto(TEST_URL,wait_until="domcontentloaded")ip=json.loads(awaitpage.text_content("body"))["ip"]awaitcontext.close()returnipasyncdefmain():asyncwithasync_playwright()asp:browser=awaitp.chromium.launch(headless=True,proxy={"server":"per-context"},# <-- requiredargs=["--disable-blink-features=AutomationControlled"], )ctx1=awaitbrowser.new_context(proxy=PROXY)print("CTX-1 IP ⇒",awaitfetch_ip(ctx1))awaitbrowser.close()asyncio.run(main())
Expected behavior
CTX-1 IP ⇒ <IP-from-proxy>
Actual behavior
CTX-1 ⇒ <host-public-IP>
Additional context
When Chromium is launched with proxy={"server": "per-context"} inside a Docker container, no context created with browser.new_context(proxy=…) uses the proxy at all—all requests always fall back to the container’s outbound IP.
Environment
- Operating System: [Ubuntu 22.04]- CPU: [amd64]- Browser: [Chromium]- Python Version: [3.12]- Docker img: mcr.microsoft.com/playwright/python:v1.52.0-noble- Other info:
Metadata
Metadata
Assignees
Labels
No labels