Basic setup
Key steps
Pass the proxy server on launch
Use the
--proxy-server flag in the args array when launching the browser. This sets the proxy at the browser level.Authenticate on the page
Call
page.authenticate() with your proxy username and password before navigating to any page.Rotating through multiple proxies
To use different proxies for different tasks, launch separate browser instances:Each browser instance maintains its own proxy connection. Close the browser and launch a new one to switch proxies.
Headless vs headful
Common issues
ERR_PROXY_CONNECTION_FAILED
ERR_PROXY_CONNECTION_FAILED
Verify that your proxy host and port are correct. Ensure the proxy is active in your dashboard.
407 Proxy Authentication Required
407 Proxy Authentication Required
Make sure you call
page.authenticate() before navigating to any URL.Page loads but shows real IP
Page loads but shows real IP
The
--proxy-server flag only accepts host:port. Authentication must be done separately via page.authenticate().Related
Making Your First Request
Quick start code examples in multiple languages
Connection Errors
Diagnose and fix common proxy issues
