Chrome automation by Google. Configure Puppeteer to use KnoxProxy for headless browser scraping, screenshot capture, and PDF generation.
Install with bundled Chromium.
npm install puppeteerPass proxy via Chrome args.
const browser = await puppeteer.launch({
args: ['--proxy-server=http://gw.knoxproxy.com:7000'],
});Use page.authenticate() for proxy auth.
const page = await browser.newPage();
await page.authenticate({ username: 'USER', password: 'PASS' });Browse through the proxy.
await page.goto('https://httpbin.org/ip');
const content = await page.$eval('pre', el => el.textContent);
console.log(content);Add country to username.
await page.authenticate({ username: 'USER-country-us', password: 'PASS' });Verify exit IP.
await page.goto('https://httpbin.org/ip');/**
* KnoxProxy + Puppeteer -- headless Chrome with proxy.
*/
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
args: ['--proxy-server=http://gw.knoxproxy.com:7000'],
headless: 'new',
});
const page = await browser.newPage();
await page.authenticate({ username: 'USER', password: 'PASS' });
await page.goto('https://httpbin.org/ip');
const ip = await page.$eval('pre', el => el.textContent);
console.log('Exit IP:', ip);
await browser.close();
})();Close and re-launch browser for new IP, or use -session-{id} in username. page.authenticate can be called with different usernames between navigations.
| Problem | Fix |
|---|---|
| net::ERR_PROXY_CONNECTION_FAILED | Verify --proxy-server arg format and port. |
| Navigation timeout of 30000ms exceeded | Increase timeout: page.goto(url, { timeout: 60000 }). |
| ERR_PROXY_AUTH_FAILED | Call page.authenticate() before any navigation. Verify credentials. |
USER-country-de-city-berlin-session-profile07Order matters -- geo flags before the session flag. The session name is free text; use the profile ID so the mapping is self-documenting. Password stays as issued; no flags belong there. HTTP on :7000, SOCKS5 on :7001, same credentials.
Call page.authenticate({ username, password }) with your KnoxProxy credentials before any navigation on that page. This method answers the proxy 407 authentication challenge automatically behind the scenes. Because Puppeteer scopes authentication to individual pages rather than the whole browser, you must call page.authenticate() again on every new page or tab you open.
No, Puppeteer has no built-in way to assign a different proxy to individual tabs within the same browser instance. If you need multiple proxy configurations at once, launch separate Puppeteer browser instances, each with its own --proxy-server argument and KnoxProxy credentials, or switch to Playwright, which supports per-context proxies without spinning up separate browser processes.
For new projects, Playwright offers better proxy support out of the box, including per-context proxies and native username and password authentication without extra API calls. If you already have an existing Puppeteer codebase, there is no need to migrate: KnoxProxy works fine through the standard page.authenticate() API, just with one call required per page.
Yes. Pass --proxy-server=socks5://gw.knoxproxy.com:7001 in the launch args to route Puppeteer through the KnoxProxy SOCKS5 gateway instead of the default HTTP port. Authentication still works the same way as HTTP proxies: call page.authenticate({ username, password }) on each page before navigating, since SOCKS5 does not change how Puppeteer requests proxy credentials.
Rotating residential proxies -- 5 minutes setup, instant activation, 14-day money-back guarantee.