Skip to main content
Puppeteer is a Node.js library for controlling headless Chrome. This guide shows how to route all of its traffic through Stat Proxies.

Basic setup

Key steps

1

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.
2

Authenticate on the page

Call page.authenticate() with your proxy username and password before navigating to any page.
3

Navigate normally

All requests from this browser instance will now route through your proxy.

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

Verify that your proxy host and port are correct. Ensure the proxy is active in your dashboard.
Make sure you call page.authenticate() before navigating to any URL.
The --proxy-server flag only accepts host:port. Authentication must be done separately via page.authenticate().

Making Your First Request

Quick start code examples in multiple languages

Connection Errors

Diagnose and fix common proxy issues