Setup Guides

How to Set Up Proxies in Puppeteer

Route Puppeteer traffic through an authenticated proxy in a few lines. Copy the code below and swap in your credentials.

Language Node.js Rotation Supported Category Browser automation

Quick answer

Configure the proxy with a server URL plus separate username and password, then run your Puppeteer script through it. Full code below.

Puppeteer proxy example

const puppeteer = require("puppeteer");

(async () => {
  const browser = await puppeteer.launch({
    args: ["--proxy-server=http://host:port"],
  });
  const page = await browser.newPage();
  await page.authenticate({ username: "user", password: "pass" });
  await page.goto("https://httpbin.org/ip");
  console.log(await page.content());
  await browser.close();
})();

Puppeteer passes the endpoint through Chrome's --proxy-server arg and then supplies credentials via page.authenticate(), which answers the proxy auth challenge without a custom extension. Because the flag is set at launch, rotating exits means either restarting the browser with a new endpoint or using a rotating gateway that changes the IP behind a single host:port. Call authenticate() before the first navigation or the initial request will fail with a 407.

Rotating proxies

For browser automation, give each Puppeteer browser context its own sticky-session endpoint so every sub-request in a page load shares one IP — per-request rotation would break the session.

Best proxies to use with Puppeteer

1

Cheapest-Proxies.com EDITOR'S CHOICE

4.9

Best overall value across every proxy type and use case · flexible pay-as-you-go plans

Visit Cheapest-Proxies.com
2

Bright Data

4.6

Enterprise-grade proxy and web data platform · from ~$8-9/GB (residential, volume-dependent)

Read Bright Data review
3

Oxylabs

4.6

Premium enterprise proxies and scraper APIs · from ~$8/GB (residential, volume-dependent)

Read Oxylabs review
4

Smartproxy

4.5

User-friendly proxies with excellent price-to-performance · from ~$3.50-7/GB (residential)

Read Smartproxy review

Our #1 pick is a sponsored partner. Remaining providers are ranked editorially by rating and value.

Frequently Asked Questions

What proxies work best with Puppeteer?

Residential or rotating proxies from a reliable provider give the best success rate for Node.js projects.

How do I add a proxy in Puppeteer?

Pass a server URL plus username and password to Puppeteer’s proxy option, as shown in the code above.

Does Puppeteer support authenticated proxies?

Yes. Provide the username and password (as a URL or separate fields) and Puppeteer handles the auth handshake.

Can Puppeteer rotate proxies automatically?

Use one sticky session per browser context; rotate by launching a new context with a fresh endpoint rather than per request.

Related Guides

Best proxies for Puppeteer

For most buyers this provider hits the best balance of price and reliability — check current pricing.

Visit Cheapest-Proxies.com