Skip to content

v0.4.3: pyppeteer proxy auth via Fetch, refuse credentialed SOCKS - #9

Merged
chakh1ik merged 1 commit into
mainfrom
fix/pyppeteer-proxy-auth
Oct 19, 2026
Merged

chakh1ik merged 1 commit into
mainfrom
fix/pyppeteer-proxy-auth

Conversation

@chakh1ik

Copy link
Copy Markdown
Collaborator

Problems found in the live proxy test

  1. pyppeteer + a proxy with credentials crashed. page.authenticate() calls Network.setRequestInterception, which current Chrome no longer has: Protocol error (Network.setRequestInterception): 'Network.setRequestInterception' wasn't found.
  2. socks5://user:pass@… crashed Playwright with a traceback: Browser does not support socks5 proxy authentication.

Fix

  • pyppeteer answers the proxy's auth challenge through the CDP Fetch domain (Fetch.enable with handleAuthRequests, then Fetch.continueWithAuth). Credentials go only to a challenge whose source is Proxy.
  • proxy_pool.parse_proxy_line refuses a credentialed SOCKS proxy as bad usage (exit 2). The message does not echo the password. A SOCKS proxy without credentials is still accepted.
  • README limitation, CHANGELOG, .gitignore gets .venv-*/.

Verified live

The test ran through a local HTTP proxy that requires a login and password (it rejects missing or wrong credentials) and forwards to a 2captcha US residential proxy.

  • Playwright: exit 0, 10 rows.
  • pyppeteer: before, a crash. After, exit 0, 10 rows, and the browser's exit IP is the US residential one. Wrong credentials: no page loads, exit 5.
  • Selenium: exit 3 with HTTP 407. This is the documented limitation: its --proxy-server cannot authenticate.
  • smoke_test.py: 79/79.

🤖 Generated with Claude Code

pyppeteer's page.authenticate() uses Network.setRequestInterception, which
current Chrome no longer has, so any proxy with credentials crashed the
run. Answer the proxy's auth challenge through the CDP Fetch domain
instead. A socks5:// proxy with credentials is now bad usage (exit 2)
rather than a Playwright traceback, since Chromium cannot authenticate to
SOCKS. Also ignore the per-engine .venv-*/ environments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chakh1ik
chakh1ik merged commit 8cf59d3 into main Oct 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant