Integrations

Browser automation

Playwright, Puppeteer and Selenium drive a real browser, and a real browser cannot send a password to a SOCKS5 proxy. Use the HTTP port with a username and password, or the IP whitelist.

Updated 16 October 2026

Playwright#

import { chromium } from "playwright";

const browser = await chromium.launch({
  proxy: {
    server: "http://HOST:PORT",
    username: "USER",
    password: "PASS",
  },
});
const page = await browser.newPage();
await page.goto("https://api.ipify.org");
console.log(await page.textContent("body"));
await browser.close();

A different proxy per context#

One browser can run many isolated contexts, each with its own proxy, cookies and storage. That is cheaper than one browser per identity.

JavaScript
// One browser, a different proxy for every context
const browser = await chromium.launch();

const a = await browser.newContext({
  proxy: { server: "http://HOST_A:PORT_A", username: "USER", password: "PASS" },
});
const b = await browser.newContext({
  proxy: { server: "http://HOST_B:PORT_B", username: "USER", password: "PASS" },
});

Puppeteer#

Chrome takes the proxy address as a launch flag and the credentials through page.authenticate.

JavaScript
import puppeteer from "puppeteer";

const browser = await puppeteer.launch({
  args: ["--proxy-server=http://HOST:PORT"],
});
const page = await browser.newPage();
await page.authenticate({ username: "USER", password: "PASS" });
await page.goto("https://api.ipify.org");
console.log(await page.evaluate(() => document.body.innerText));
await browser.close();

Selenium#

Plain Selenium cannot give Chrome a proxy password. There are two clean ways around it.

SeleniumBase

SeleniumBase handles proxy authentication itself:

Python
# pip install seleniumbase
from seleniumbase import SB

with SB(proxy="USER:PASS@HOST:PORT") as sb:
    sb.open("https://api.ipify.org")
    print(sb.get_text("body"))

IP whitelist

On ISP and datacenter orders add the server's address to the IP whitelist and give Chrome the proxy with no credentials:

Python
# Works when your server's IP is in the order's whitelist:
# Chrome cannot take a username and password in --proxy-server.
from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument("--proxy-server=http://HOST:PORT")

driver = webdriver.Chrome(options=options)
driver.get("https://api.ipify.org")
print(driver.find_element("tag name", "body").text)
driver.quit()

With residential proxies#

  • Use a sticky line per browser or context, so the page, its scripts and its API calls all leave from the same address.
  • Block images, media and fonts you do not need: every byte a browser fetches is billed. See traffic.
  • Turn off browser updates and component downloads in automated profiles.

Didn't find the answer?

Support answers in the chat on this site around the clock. On Telegram the reply usually comes fastest, and a ticket gets an answer by email.