proxiesseller

Puppeteer & Playwright Proxies (Node.js) — Reliable Setup

Use proxies with Playwright and Puppeteer for JS-heavy sites, including auth patterns.

Published January 08, 20266 min read

Overview

Playwright and Puppeteer support proxies cleanly. This guide shows proxy configuration and authentication patterns that work in production.

Installation & Setup

Install Playwright:

npm i playwright

Examples

import { chromium } from "playwright";

const browser = await chromium.launch({
  proxy: { server: "http://HOST:PORT", username: "USER", password: "PASS" },
});

const page = await browser.newPage();
await page.goto("https://api.ipify.org");
console.log(await page.textContent("body"));
await browser.close();
import puppeteer from "puppeteer";

const browser = await puppeteer.launch({
  args: ["--proxy-server=http://HOST:PORT"],
});

const page = await browser.newPage();
// if auth is needed:
await page.authenticate({ username: "USER", password: "PASS" });

await page.goto("https://api.ipify.org");
console.log(await page.evaluate(() => document.body.innerText));
await browser.close();

Troubleshooting

  • If pages load slow: reduce concurrency and enable request blocking for images/fonts
  • If auth fails: confirm you used page.authenticate (Puppeteer) or proxy credentials (Playwright)
  • If blocked: rotate IPs and reduce repeated navigation patterns