Integrate with Puppeteer
Use Aluvia's mobile network connectivity with Puppeteer for browser automation, testing, and data extraction using real mobile IP addresses.
Setup Steps
- Get your proxy credentials in your Aluvia Dashboard
- Install Puppeteer in your project if not already installed
- Configure your Puppeteer launch with the Aluvia proxy host and port
- Set the proxy server using the
--proxy-serverlaunch argument - Use
page.authenticate()to provide your Aluvia proxy username and password - Launch the browser and test a request (e.g., visiting https://ipconfig.io/json) to confirm the proxy is working
Sample Code
const puppeteer = require("puppeteer");
const PROXY_HOST = "gateway.aluvia.io";
const PROXY_PORT = 8080;
const PROXY_USER = "your_credential_username";
const PROXY_PASS = "your_credential_password";
(async () => {
const browser = await puppeteer.launch({
headless: true,
args: [`--proxy-server=http://${PROXY_HOST}:${PROXY_PORT}`],
});
const page = await browser.newPage();
await page.authenticate({
username: PROXY_USER,
password: PROXY_PASS,
});
try {
await page.goto("https://ipconfig.io/json", { waitUntil: "networkidle2" });
const content = await page.content();
console.log(content);
} catch (err) {
console.error(err);
} finally {
await browser.close();
}
})();