Code / Puppeteer

How to Use Proxies with Puppeteer

Launch Puppeteer with your Typroxy HTTP endpoint and supply the username and password before navigating. This Node.js example requests your public IP so you can confirm the browser is using the proxy.

Last checked:

Before you start

Get your proxy details from Dashboard → Proxies. You'll need the host, port, username and password.

Replace HOST, PORT, USERNAME and PASSWORD in the examples with your own details. Use the port that matches your connection type.

Get a proxy

Code examples

Authenticated HTTP proxy

Install dependencies

npm install puppeteer
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: "USERNAME", password: "PASSWORD" });
  await page.goto("https://api.ipify.org?format=json");
  console.log(await page.evaluate(() => document.body.innerText));
  await browser.close();
})();

Check it worked

Run the example above to open https://api.ipify.org?format=json through the proxy. The IP shown should be your proxy's IP, not your own.

Read the IP printed by the script, rather than opening the link in an unconfigured browser. A rotating proxy's IP can change between requests.

Troubleshooting

407 Proxy Authentication Required
Username or password is wrong; copy them again from the dashboard.
Connection timed out / refused
Check host and port, and that the proxy is Active (not expired) in the dashboard.
IP shows my own address
The proxy isn't applied; re-check the settings and restart the browser profile or script.
Wrong country
Check which location you bought in the dashboard.

Still stuck? Open a support ticket — include your order ID.

Frequently asked questions

Need a proxy for this?

Static residential proxies work best for account management; rotating residential for scraping.