Configure TrueProxies with Puppeteer
Basic Usage
Section titled “Basic Usage”import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ args: ['--proxy-server=http://YOUR_HOST:YOUR_HTTP_PORT'],});
const page = await browser.newPage();
await page.authenticate({ username: 'your_username', password: 'your_password',});
await page.goto('https://httpbin.org/ip');const content = await page.content();console.log(content);
await browser.close();import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ args: ['--proxy-server=socks5://YOUR_HOST:YOUR_SOCKS_PORT'],});
const page = await browser.newPage();
await page.authenticate({ username: 'your_username', password: 'your_password',});
await page.goto('https://httpbin.org/ip');const content = await page.content();console.log(content);
await browser.close();Residential IPv4 country targeting
Section titled “Residential IPv4 country targeting”await page.authenticate({ username: 'your_username-country-us', password: 'your_password',});Residential IPv4 sticky sessions
Section titled “Residential IPv4 sticky sessions”await page.authenticate({ username: 'your_username-session-abc123', password: 'your_password',});Multiple Pages with Different IPs
Section titled “Multiple Pages with Different IPs”const browser = await puppeteer.launch({ args: ['--proxy-server=http://YOUR_HOST:YOUR_HTTP_PORT'],});
const urls = ['https://example.com', 'https://example.org'];
for (const url of urls) { const page = await browser.newPage(); await page.authenticate({ username: 'your_username', password: 'your_password', }); await page.goto(url); console.log(`${url}: loaded`); await page.close();}
await browser.close();