Block images via Chrome flag, not route interception; restore DataImpulse URL auth
context.route() (request interception) breaks URL-embedded proxy auth in Chromium — DataImpulse proactive CONNECT auth stops working when interception is active. Replace route handler with --blink-settings=imagesEnabled=false Chrome flag to block images without touching the interception layer. Restore DataImpulse URL-embedded credentials (unchanged from before IPRoyal work). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d223a449c3
commit
d28c738475
2 changed files with 14 additions and 37 deletions
|
|
@ -109,9 +109,16 @@ def playwright_proxy(cfg: dict, session_id: Optional[str] = None) -> Optional[di
|
|||
return None
|
||||
user, pwd = _build_auth(cfg, session_id)
|
||||
server = f"http://{cfg['host']}:{cfg['port']}"
|
||||
# Both providers use separate fields — URL-embedded credentials stop being
|
||||
# forwarded by Chromium when request interception (context.route) is active.
|
||||
return {'server': server, 'username': user, 'password': pwd}
|
||||
if _provider(cfg) == 'iproyal':
|
||||
# IPRoyal requires separate fields — Chromium silently drops
|
||||
# URL-embedded credentials for this provider.
|
||||
return {'server': server, 'username': user, 'password': pwd}
|
||||
from urllib.parse import quote
|
||||
# DataImpulse: credentials in URL so Chromium sends Proxy-Authorization
|
||||
# proactively on CONNECT (avoids a ~14s 407 round-trip).
|
||||
return {
|
||||
'server': f"http://{quote(user, safe='')}:{quote(pwd, safe='')}@{cfg['host']}:{cfg['port']}",
|
||||
}
|
||||
|
||||
|
||||
def httpx_proxy(cfg: dict, session_id: Optional[str] = None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue