Fix DataImpulse Playwright auth: use separate fields not URL-embedded
URL-embedded proxy credentials are dropped by Chromium when request interception (context.route) is active. Both providers now use separate username/password fields; DataImpulse incurs a 14s 407 round-trip on context rotation but this only happens every 40 requests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f6d5fb27e1
commit
d223a449c3
1 changed files with 3 additions and 6 deletions
|
|
@ -109,12 +109,9 @@ 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']}"
|
||||
if _provider(cfg) == 'iproyal':
|
||||
# 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}
|
||||
from urllib.parse import quote
|
||||
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