2026-10-27 · VeilSocks

Authenticated proxies look simple — host, port, username, password — and then you spend forty minutes wondering why curl works and Playwright doesn't, or why your SOCKS5 auth silently fails in Python. The format is almost the same everywhere, and it's the "almost" that gets you.

Here's the syntax that actually works in each, plus the specific thing people get wrong.

curl

The easy one:

curl -x http://user:pass@host:port "https://api.ipify.org?format=json"

For SOCKS5, use socks5h:// rather than socks5:// — the h means curl sends the hostname to the proxy to resolve, instead of resolving DNS locally and leaking it. Same fix applies everywhere DNS matters.

Python (requests)

Auth goes straight in the URL:

proxies = {"http": "http://user:pass@host:port", "https": "http://user:pass@host:port"}

then requests.get(url, proxies=proxies). The gotcha: for SOCKS5 you need the extra dependency — pip install "requests[socks]" — or you'll get a cryptic "Missing dependencies for SOCKS support" that has nothing to do with your credentials. Everyone hits this once.

Playwright

This is where people copy the curl format and it breaks. Playwright does not take credentials in the server URL. Username and password are separate fields:

chromium.launch({ proxy: { server: "http://host:port", username: "user", password: "pass" } })

Put user:pass@ in the server string and it'll either ignore it or error. Separate fields, every time.

Puppeteer

Different again. You pass the proxy as a launch argument with no auth in it, then authenticate on the page:

puppeteer.launch({ args: ["--proxy-server=http://host:port"] })
// then, per page:
await page.authenticate({ username: "user", password: "pass" });

Miss the page.authenticate call and every request comes back as a 407.

Node (undici / fetch)

Native fetch doesn't speak proxies, so you reach for undici's ProxyAgent. Auth is a base64 Proxy-Authorization token, not inline credentials:

new ProxyAgent({ uri: "http://host:port", token: "Basic " + Buffer.from("user:pass").toString("base64") })

then pass it as the dispatcher. The base64 bit is the part nobody remembers.

Save yourself the lookup

Honestly, I stopped memorising these. There's a proxy code generator that takes your host, port, username and password once and hands back correct snippets for all of the above plus Scrapy, Selenium, Go and PHP — with the auth handled the right way for each. Paste, run, done.

Confirm it's actually working

Whatever language you're in, point the first request at an IP-echo endpoint like https://api.ipify.org?format=json. The response should show your proxy's IP, not yours. If it shows your own, the request never went through the proxy — usually a typo in the port or, in Playwright, credentials stuffed into the wrong field. Once it echoes the proxy IP, check what that IP looks like to the outside world with what-is-my-IP, and you're genuinely set up.

And the usual reminder: proxies are for legitimate work — ad verification, QA, public-data collection, price and SERP monitoring. VeilSocks gives you SOCKS5 and HTTP on real mobile IPs that drop straight into any of these snippets.

Real 4G/5G mobile proxies, your GB never expire

Genuine US carrier SIM IPs — SOCKS5 & HTTP, pay per GB, instant activation.

Create your account →