Skip to content

Puppeteer Proxy Setup: Auth, SOCKS5, and Rotating IPs | Proxy302

Run your scraper or automation script through residential exit IPs with one launch flag and one authentication call: start Puppeteer with --proxy-server, pass your credentials to page.authenticate() before the first navigation, and every page load leaves through the Proxy302 gateway.

What you need before you start

A Node.js project with Puppeteer installed and a script that launches a browser.

A Proxy302 account with dynamic residential traffic. The Budget line costs US$1.50 per GB at any amount (US$1.35 per GB at 100 GB) and the smallest purchase is 1 GB; see the pricing page.

Your Proxy302 proxy username and password. The My assets page of the console shows HOST, PORT, USERNAME and PASSWORD for everything you bought.

The connection, field by field

Gateway host: proxy.proxy302.com — HTTP and SOCKS5 share the gateway

Port for HTTP: 2222 — the recommended endpoint for Puppeteer

Port for SOCKS5: 3333

Launch argument: --proxy-server=http://proxy.proxy302.com:2222

Authentication: await page.authenticate({ username, password }) before the first page.goto()

Where the values come from: My assets in the Proxy302 console

A complete first script

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    args: ['--proxy-server=http://proxy.proxy302.com:2222'],
  });

  const page = await browser.newPage();
  await page.authenticate({
    username: 'YOUR_PROXY_USERNAME',
    password: 'YOUR_PROXY_PASSWORD',
  });

  await page.goto('https://ipinfo.io/json');
  console.log('Exit:', await page.$eval('body', (el) => el.textContent));

  await browser.close();
})();

Runnable as shown: fill in your Proxy302 credentials and run with Node.js.

What the launch flag does

--proxy-server is a Chromium command-line switch, documented in the Chromium source as "Uses a specified proxy server, overrides system settings." Puppeteer hands it to the browser through the args option of puppeteer.launch(), which the Puppeteer API reference describes as "Additional command line arguments to pass to the browser instance." The browser runs headless by default.

Chromium recognizes http, https, socks4 and socks5 proxy schemes, so the same flag carries either endpoint: --proxy-server=http://proxy.proxy302.com:2222 or --proxy-server=socks5://proxy.proxy302.com:3333.

What page.authenticate() does

The Puppeteer API reference says page.authenticate() provides "credentials for HTTP authentication" for the page, and notes that "Request interception will be turned on behind the scenes to implement authentication." Call it before the first page.goto(), and pass null to disable it again.

This is why HTTP on port 2222 is the recommended endpoint: the browser completes the username and password log-in that every Proxy302 connection requires, inside the page itself. Use the same username and password your other tools use; they are shown in My assets.

Confirm the exit IP

Load https://ipinfo.io/json through the page. The ip and country fields should belong to the proxy exit, not to your own connection. If the printed address is your own, the launch argument did not reach the browser instance this script drives: print the exit IP first, then check which browser the script launches and configures. The proxy location guide explains the fields.

Traffic, price and expiry

Dynamic residential traffic is billed per GB on two lines: Budget from US$1.50 per GB (US$1.35 per GB at 100 GB) and Premium from US$5.00 per GB. The smallest purchase is 1 GB. Payment is prepaid, pay as you go, with no subscription, and purchased GB does not expire.

Rotating IPs vs. sticky sessions in Puppeteer

The rotating residential product page describes two behaviors: each request goes through a different real household IP, and a sticky session holds one residential IP across a sequence of requests. Per-request rotation fits scraping many pages, price checks and any job where no single IP should build up history; a sticky session fits login flows, carts and anything session-aware.

You do not manage a proxy list: one gateway and one set of credentials carry the traffic. How a line is set to one behavior or the other is not described on the product page, so confirm it instead of assuming it: load https://ipinfo.io/json across two requests from the script and compare the exit IP — a different address each time means per-request rotation, the same address means the session is holding one IP.

Loop over URLs, then confirm the exit behavior

// The gateway and credentials do not change between jobs.
for (const url of urls) {
  await page.goto(url, { waitUntil: 'domcontentloaded' });
  // ...extract what you need
}

// Confirm which behavior your line uses: load an IP-echo page twice
// and compare the exit IP.
for (let i = 0; i < 2; i++) {
  await page.goto('https://ipinfo.io/json', { waitUntil: 'domcontentloaded' });
  console.log('Exit:', await page.$eval('body', (el) => el.textContent));
}

Runnable as shown: fill in your Proxy302 credentials and run with Node.js.

Using SOCKS5 with Puppeteer

The SOCKS5 endpoint is port 3333 on the same gateway. There is a catch in the browser itself: the SOCKS5 client in Chromium — the engine Puppeteer drives — sends a greeting that offers exactly one method, "no authentication", and the handshake only proceeds when the server selects it. Chromium never offers SOCKS5 username and password authentication, and every Proxy302 connection requires your username and password.

That leaves three practical paths. One: use HTTP on port 2222 — authentication works end to end through page.authenticate() as shown above, and nothing else changes. Two: run a small local forwarder on your machine that accepts the browser's unauthenticated connection and forwards it to the authenticated SOCKS5 endpoint — worth it only for jobs that need SOCKS5 specifically, since for plain web traffic the HTTP path does the same work. Three: use SOCKS5 from a tool outside the browser that implements SOCKS5 username and password authentication itself.

SOCKS5 from outside the browser: curl

curl -x socks5h://USERNAME:[email protected]:3333 https://ipinfo.io/json

Runnable as shown: fill in your Proxy302 credentials and run with Node.js.

Why socks5h and not socks5

Keep the h in socks5h://. The libcurl documentation defines socks5h:// as "SOCKS5 Proxy. Proxy resolves URL hostname", while plain socks5:// resolves the hostname on your machine before contacting the proxy. Resolving on the proxy side keeps the site's view of your DNS consistent with your exit IP. The same documentation confirms the credential style scheme://username:password@hostname used in the command above.

Common errors and what to check

net::ERR_NO_SUPPORTED_PROXIES: The Chromium error list describes this as "There are no supported proxies in the provided list." Check the --proxy-server value: keep a supported scheme (http:// or socks5://) and a correct host:port.

net::ERR_PROXY_CONNECTION_FAILED: "Could not create a connection to the proxy server. An error occurred either in resolving its name, or in connecting a socket to it", per the Chromium error list. Check the host spelling proxy.proxy302.com, port 2222 (HTTP) or 3333 (SOCKS5), and that your network allows outbound connections to the gateway.

HTTP 407 or repeated auth prompts: page.authenticate() must run before the first page.goto(). Re-copy the username and password with no stray spaces or line breaks.

Pages load but show your own IP: The launch argument did not reach this browser instance. Print the exit IP first, then check that the script launches the browser it configures.

Timeouts on slow targets: Raise the page.goto() timeout for the job and confirm the account still has traffic.

FAQ

How do I use a proxy in Puppeteer?

Launch the browser with args: ['--proxy-server=http://proxy.proxy302.com:2222'], call page.authenticate({ username, password }) on the page before the first navigation, and load https://ipinfo.io/json to confirm the exit IP changed. Dynamic residential traffic starts at US$1.50 per GB with a 1 GB minimum.

How do I set a SOCKS5 proxy in Puppeteer?

Chromium accepts socks5://proxy.proxy302.com:3333 in --proxy-server, but its SOCKS5 client offers only the no-authentication method, so the username and password log-in every Proxy302 connection requires cannot complete inside the browser. Use HTTP on 2222 with page.authenticate(), put a local forwarder in front of port 3333, or use SOCKS5 from a tool outside the browser, such as curl with socks5h://.

How do I rotate proxies in Puppeteer?

You do not manage a proxy list. One gateway and one set of credentials carry dynamic residential traffic, which the product page describes two ways: each request through a different household IP, or a sticky session holding one residential IP across a sequence of requests. The page does not describe how a line is switched between the two, so confirm before you rely on either: load https://ipinfo.io/json across two requests from the script and compare the exit IP.

How do I pass a username and password to the proxy?

With page.authenticate({ username, password }) on each page, before the first page.goto(). It delivers the HTTP authentication credentials for the page; pass null to clear them. Use the same Proxy302 username and password your other tools use — they are shown in My assets.

Which protocol should I use with Puppeteer — HTTP or SOCKS5?

HTTP on port 2222. It is the endpoint where browser-side authentication works end to end with page.authenticate(). Keep SOCKS5 on 3333 for tools that complete SOCKS5 username and password authentication themselves, such as curl with socks5h://.

Why do I get 407 or a proxy connection error in Puppeteer?

407 means authentication did not reach the proxy: call page.authenticate() before the first navigation and re-copy the credentials. A connection failure usually means the host, port or scheme in --proxy-server is wrong — proxy.proxy302.com:2222 with http:// — or your network blocks outbound connections to the gateway.

Reference links

10
  1. Puppeteer API reference: LaunchOptions

    Third-party source · Confirmed on:

    Read on 28 October 2026: args is "Additional command line arguments to pass to the browser instance."; headless is "Whether to run the browser in headless mode" and defaults to true.

  2. Puppeteer API reference: page.authenticate()

    Third-party source · Confirmed on:

    Read on 28 October 2026: provides "credentials for HTTP authentication"; "Request interception will be turned on behind the scenes to implement authentication"; "To disable authentication, pass null."

  3. Chromium source: chrome/common/chrome_switches.h

    Third-party source · Confirmed on:

    Read from the official chromium/chromium repository (main branch) on 28 October 2026: the comment above kProxyServer[] = "proxy-server" (lines 640-641) reads "Uses a specified proxy server, overrides system settings."

  4. Chromium source: net/socket/socks5_client_socket.cc

    Third-party source · Confirmed on:

    Read from the official chromium/chromium repository (main branch) on 28 October 2026: the SOCKS5 greeting is hard-coded as kSOCKS5GreetWriteData {0x05, 0x01, 0x00} with the comment "no authentication", and the client requires the server to select method 0x00 or the handshake fails (ERR_SOCKS_CONNECTION_FAILED). Chromium never offers SOCKS5 username and password authentication.

  5. Chromium source: net/base/proxy_server.cc

    Third-party source · Confirmed on:

    Read from the official chromium/chromium repository (main branch) on 28 October 2026: the valid proxy schemes include SCHEME_HTTP, SCHEME_SOCKS4, SCHEME_SOCKS5, SCHEME_HTTPS and SCHEME_QUIC; the default port for SOCKS4 and SOCKS5 is 1080.

  6. Chromium source: net/base/net_error_list.h

    Third-party source · Confirmed on:

    Read from the official chromium/chromium repository (main branch) on 28 October 2026: NO_SUPPORTED_PROXIES (-336) "There are no supported proxies in the provided list."; PROXY_CONNECTION_FAILED (-130) "Could not create a connection to the proxy server. An error occurred either in resolving its name, or in connecting a socket to it."

  7. libcurl documentation: CURLOPT_PROXY

    Third-party source · Confirmed on:

    Read from the official curl/curl repository (master branch) on 28 October 2026: "socks5h:// — SOCKS5 Proxy. Proxy resolves URL hostname." (plain socks5:// is listed without that note); proxy credentials may be given in the URL style scheme://username:password@hostname.

  8. Proxy302 guide: proxy address, port and login

    Product observation · Confirmed on:

    Read on 28 October 2026: for rotating residential proxies the gateway is proxy.proxy302.com, port 2222 for HTTP and 3333 for SOCKS5; HOST, PORT, USERNAME and PASSWORD are shown on the My assets page.

  9. Proxy302: rotating residential proxies

    Product observation · Confirmed on:

    Read on 28 October 2026: each request goes through a different real household IP; a sticky session holds one residential IP across a sequence of requests; HTTP and SOCKS5; billed per GB.

  10. Proxy302 pricing

    Product observation · Confirmed on:

    Read on 28 October 2026 (page states its prices come from the live price catalogue of 18 October 2026, in US dollars, 1 PTC = US$1.00): Budget residential US$1.50/GB at any amount, US$1.35/GB at 100 GB; Premium from US$5.00/GB; minimum purchase 1 GB; purchased GB has no expiry; no subscription, pay as you go.

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.