Puppeteer
Puppeteer is a Node.js library that provides a high-level API to control Chrome/Chromium. It's widely used for web scraping, testing, and browser automation. Configuring HypeProxy.io proxies with Puppeteer is straightforward.
Setting Up HypeProxy.io with Puppeteer
Basic Proxy Configuration
const puppeteer = require('puppeteer');
const browser = await puppeteer.launch({
args: ['--proxy-server=http://fr.hypeproxy.host:port']
});
const page = await browser.newPage();
// Authenticate with the proxy
await page.authenticate({
username: 'your_username',
password: 'your_password'
});
await page.goto('https://api.ipify.org');
const ip = await page.evaluate(() => document.body.textContent);
console.log(`Proxy IP: ${ip}`);
await browser.close();
SOCKS5 Proxy
const browser = await puppeteer.launch({
args: ['--proxy-server=socks5://fr.hypeproxy.host:port']
});
With IP Rotation via API
const puppeteer = require('puppeteer');
const API_TOKEN = 'YOUR_API_TOKEN';
const PROXY_ID = 'YOUR_PROXY_ID';
// Rotate IP before scraping
await fetch(`https://api.hypeproxy.io/Utils/DirectRenewIp/${PROXY_ID}`, {
headers: { 'Authorization': `Bearer ${API_TOKEN}` }
});
// Wait for rotation
await new Promise(r => setTimeout(r, 5000));
const browser = await puppeteer.launch({
args: ['--proxy-server=http://fr.hypeproxy.host:port']
});
const page = await browser.newPage();
await page.authenticate({ username: 'user', password: 'pass' });
await page.goto('https://example.com');
await browser.close();
Tips
- Use
page.authenticate()for proxy credentials — this handles HTTP proxy authentication cleanly. - For headless scraping at scale, combine Puppeteer with HypeProxy.io mobile proxies for the best anti-detection results.
- Add
--disable-web-securityand--disable-features=IsolateOrigins,site-per-processflags if needed for specific scraping tasks. - Use
puppeteer-extrawith the stealth plugin for additional anti-detection capabilities.
