Mobile proxies in Playwright, Puppeteer and Selenium

Headless Chromium has one well-known gap: it does not support SOCKS5 with a username and password. Here are two clean ways around it.

See plans from $75/mo ♡ Read the docs

Option A — a local forwarder

Run a tiny relay on your own machine that logs in to the handset for you and exposes an open local port. The browser then needs no credentials.

pip install pproxy
pproxy -l http://127.0.0.1:8899 -r socks5://HOST:PORT#USERNAME:PASSWORD
// Playwright (Node.js)
const { chromium } = require('playwright');
const browser = await chromium.launch({ proxy: { server: 'http://127.0.0.1:8899' } });
const page = await browser.newPage();
await page.goto('https://nekokittysllc.com/ip');
// Puppeteer
const browser = await puppeteer.launch({ args: ['--proxy-server=http://127.0.0.1:8899'] });

Option B — use Firefox

Playwright's Firefox build accepts authenticated SOCKS directly:

const { firefox } = require('playwright');
const browser = await firefox.launch({
  proxy: { server: 'socks5://HOST:PORT', username: 'USERNAME', password: 'PASSWORD' }
});

Selenium

Point ChromeDriver at the forwarder from option A with --proxy-server, exactly as in the Puppeteer line above.

Rotating between runs

await fetch('https://YOUR-PRIVATE-CHANGE-IP-LINK');
await new Promise(r => setTimeout(r, 8000)); // let the handset reattach

Questions

Is the local forwarder a security risk?

Bind it to 127.0.0.1 as shown so only programs on your own computer can reach it.

Can I run many browser contexts on one line?

Technically yes. They will all share one address, so separate identities need separate lines.

Related guides

Ready for your own dedicated private mobile proxy? 🎀

Real AT&T, Verizon and T-Mobile SIMs · unlimited data · one-tap IP rotation · delivered by email or Telegram.