Skip to content

Pyppeteer and PuppeteerSharp Proxy: Settings and Login

The proxy goes in the launch arguments and the login goes on the page; here is the code for Python and C#.

How both libraries take a proxy

pyppeteer and PuppeteerSharp both start Chromium, so the proxy is a Chromium flag passed in the launch arguments: args in pyppeteer, Args in PuppeteerSharp's LaunchOptions. Chromium expects the flag value as a URI such as http://HOST:PORT.

The flag has no place for a username and password. Give them to the page with authenticate, which answers the proxy's login request.

pyppeteer and PuppeteerSharp side by side

pyppeteer and PuppeteerSharp side by side
Itempyppeteer (Python)PuppeteerSharp (.NET)
Installpip install pyppeteer (Python 3.8 or newer)dotnet add package PuppeteerSharp
BrowserBundled Chromium by defaultBrowserFetcher().DownloadAsync() downloads a browser
Proxy flaglaunch(args=["--proxy-server=..."])LaunchOptions { Args = new[] { "--proxy-server=..." } }
Loginawait page.authenticate({"username", "password"})await page.AuthenticateAsync(new Credentials { ... })
Project statusIts README says it is unmaintained and suggests playwright-pythonCheck the project's releases before you start

From the pyppeteer and PuppeteerSharp documentation and source read on 16 November 2026.

pyppeteer: proxy flag and login

import asyncio
from pyppeteer import launch

async def main():
    browser = await launch(
        headless=True,
        args=["--proxy-server=http://HOST:2222"],
    )
    page = await browser.newPage()
    await page.authenticate({"username": "LOGIN", "password": "PASSWORD"})
    await page.goto("https://ipinfo.io/json")
    print(await page.evaluate("document.body.innerText"))
    await browser.close()

asyncio.run(main())

Example only: replace HOST, LOGIN and PASSWORD with the values from My assets.

PuppeteerSharp: proxy flag and login

using PuppeteerSharp;

await new BrowserFetcher().DownloadAsync();

await using var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
    Headless = true,
    Args = new[] { "--proxy-server=http://HOST:2222" }
});
await using var page = await browser.NewPageAsync();
await page.AuthenticateAsync(new Credentials { Username = "LOGIN", Password = "PASSWORD" });
await page.GoToAsync("https://ipinfo.io/json");
Console.WriteLine(await page.EvaluateExpressionAsync<string>("document.body.innerText"));

Example only: replace HOST, LOGIN and PASSWORD; top-level statements as in a .NET console project.

HTTP or SOCKS5

The Chromium documentation says no authentication methods are supported for SOCKSv5 in Chrome, so a SOCKS5 proxy with a login does not work through --proxy-server. Use an HTTP address with the same login: port 2222 on Proxy302.

You do not always need to buy again. A static ISP IP leased per IP also connects over HTTP on port 2222, and rotating residential and newly bought per-GB Fixed ISP take both ports on the same username and password.

One proxy per browser, not per page

--proxy-server is a flag of the browser process, so every page opened in that browser uses it. For several IPs, launch one browser per proxy, or point one browser at a rotating gateway that gives a new IP per connection.

Puppeteer's documentation says authenticate turns on request interception behind the scenes, which might affect performance. These libraries follow that API, so measure a run before you scale it.

Is pyppeteer the right tool for new work?

The pyppeteer README calls the repository unmaintained and suggests playwright-python. If you are free to choose, Playwright has proxy login built into its launch options; if you must keep pyppeteer, pin your versions and test the proxy setup on every upgrade.

Set it up and prove the exit in 5 steps

  1. Step 1: Get an HTTP proxy

    Buy a static ISP IP or use rotating residential traffic (no protocol to pick; use HTTP on port 2222), then copy HOST, PORT, USERNAME and PASSWORD from My assets.

  2. Step 2: Test it with curl

    Run curl -x http://LOGIN:PASSWORD@HOST:2222 https://ipinfo.io/json before touching the code.

    Expected result JSON with the proxy's IP and country.

  3. Step 3: Add the flag and authenticate

    Copy the pyppeteer or PuppeteerSharp example and fill in your values.

  4. Step 4: Open ipinfo.io

    Run it and read the page text.

    Expected result The same IP as in step 2.

  5. Step 5: Open your real target

    Replace the test URL only after the IP matches.

If it does not work

The page shows your own IP

Check Whether the flag is in the launch arguments, spelled --proxy-server=http://HOST:PORT, with the scheme.

Fix Fix the argument and launch a fresh browser; an already running browser keeps its old setting.

Stop when Still your own IP: test the same address with curl.

ERR_PROXY_CONNECTION_FAILED

Check Host and port, and whether your network can reach the proxy port.

Fix Correct them or test from another network.

Stop when Address and port are right: see the connection-failed guide.

407 or a sign-in prompt

Check That authenticate runs before the first navigation and the login is copied in full.

Fix Move the authenticate call above goto and copy the login again.

Stop when Same result in curl: open a ticket with the order number.

A SOCKS5 address with a login does not connect

Check Chrome supports no SOCKS5 authentication.

Fix Use the HTTP address, port 2222.

Stop when Do not keep retrying SOCKS5 here; use HTTP on port 2222.

The browser will not start after you set a path

Check executablePath or ExecutablePath replaces the bundled Chromium; pyppeteer warns this is risky.

Fix Remove it and use the bundled browser first.

Stop when It needs your own Chrome: match a Chrome version the library supports.

pyppeteer and PuppeteerSharp proxy FAQ

How do I set a proxy in pyppeteer?

Pass args=["--proxy-server=http://HOST:PORT"] to launch(), then await page.authenticate({"username": ..., "password": ...}) before the first goto.

How do I set a proxy in PuppeteerSharp?

Put "--proxy-server=http://HOST:PORT" in LaunchOptions.Args and call page.AuthenticateAsync(new Credentials { Username = ..., Password = ... }).

Can I put the login in the --proxy-server value?

Do not rely on it: the flag expects a proxy identifier and the libraries provide authenticate for the login.

Does SOCKS5 work with a username and password?

Not in Chrome, which supports no SOCKS5 authentication. Use the HTTP address on port 2222.

Is pyppeteer still maintained?

Its README says the repository is unmaintained and suggests playwright-python.

Reference links

7
  1. pyppeteer reference: launch() and Page.authenticate

    Official documentation · Confirmed on:

    Read 16 November 2026: launch() takes args, a list of additional flags for the browser process; executablePath replaces the bundled Chromium and the page warns that this is risky; Page.authenticate(credentials) takes a dict with username and password.

  2. pyppeteer on GitHub

    Official documentation · Confirmed on:

    Read 16 November 2026: described as an unofficial Python port of puppeteer; the status note says the repository is unmaintained and has seen only minor changes for a long time, and suggests playwright-python; requires Python 3.8 or newer.

  3. PuppeteerSharp API: LaunchOptions

    Official documentation · Confirmed on:

    Read 16 November 2026: LaunchOptions.Args is a string array of additional arguments for the browser instance; Headless defaults to true; ExecutablePath replaces the bundled Chromium. The docs home page gives dotnet add package PuppeteerSharp.

  4. PuppeteerSharp source: IPage.AuthenticateAsync

    Official documentation · Confirmed on:

    Read 16 November 2026: Task AuthenticateAsync(Credentials credentials) on IPage, with a Credentials class that has Username and Password; passing null disables authentication.

  5. Puppeteer docs: Page.authenticate

    Official documentation · Confirmed on:

    Read 16 November 2026: provides credentials for HTTP authentication; request interception is turned on behind the scenes to implement it, which might affect performance.

  6. Chromium docs: Proxy support in Chrome

    Official documentation · Confirmed on:

    Read 16 November 2026: command-line flags such as --proxy-server expect URI-formatted proxy identifiers; no authentication methods are supported for SOCKSv5 in Chrome.

  7. Proxy302 product facts and price list

    Product observation · Confirmed on:

    Product facts file of the site, checked 16 November 2026: prices in US$ (1 PTC = US$1), lease terms, protocols and ports (HTTP 2222, SOCKS5 3333), what each product connects over, countries and city targeting, no free trial.

Ready to try it?

Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.