407 Proxy Authentication Required comes from your proxy server, not the target website — the target never saw your request. In 90% of scripts, it is caused by one of three bugs: unencoded special characters (@, :, #, +) inside the password, sending user:pass to a port configured for IP-allowlisting (or vice versa), or omitting credentials on the https key so CONNECT tunnels send no Proxy-Authorization header.
URL-encode reserved characters. An @ or : in your password splits the URL parser early (urllib.parse.quote(password, safe='')).
Set both http and https keys in Python. Missing the https map entry sends unauthenticated CONNECT frames or bypasses the proxy.
Playwright requires a separate username/password object. Passing http://user:pass@host:port inline in server fails on several Chromium builds.
Verify credentials outside your code first. Test your exact string in curl -v or our live 3-Region Proxy Checker.
When an HTTP client receives HTTP/1.1 407 Proxy Authentication Required, stop debugging TLS fingerprints or target-site blocks — your connection stopped at hop 1 (the proxy gateway). Walk through these four checks in order.
1. Fix unencoded @, :, or # characters in the password
Many proxy providers pack session tokens and country flags into the password field. If your password contains @, :, /, or #, standard URL parsers misread the hostname:
from urllib.parse import quote
import requests
user = quote("YOUR_PROXY_KEY", safe="")
password = quote("standard-country-us-session-a1", safe="")
proxy_url = f"http://{user}:{password}@proxy.privatebyte.com:3128"
resp = requests.get(
"https://api.ipify.org?format=json",
proxies={"http": proxy_url, "https": proxy_url},
timeout=15,
)
print(resp.status_code, resp.json())
2. Pass username and password separately in Playwright
Chromium's --proxy-server flag strips inline user:pass@ credentials and immediately throws ERR_INVALID_AUTH_CREDENTIALS or 407. Always pass them as separate fields:
import { chromium } from 'playwright';
const browser = await chromium.launch({
proxy: {
server: 'http://proxy.privatebyte.com:3128',
username: process.env.PROXY_USER!,
password: 'sticky',
},
});
3. Isolate code vs credential issues with curl -v
Run a single verbose curl test from your terminal:
curl -v --proxy 'http://YOUR_KEY:[email protected]:3128' https://api.ipify.org
- If
curlalso returnsHTTP/1.1 407: your username/key is wrong, your proxy balance is$0.00, or the tier name in the password field has a typo (see our Connection Format Docs). - If
curlreturns200 OKwith an exit IP: your credentials work and your application library was droppingProxy-Authorizationon HTTPSCONNECTor redirects.
4. Test live from 3 regions (or grab $0.50 free test credit)
Paste your proxy line into our free Proxy Checker to test authentication, latency, and exit ASN from Dallas, Amsterdam, and London. If your current provider's balance expired at month-end (a common surprise cause of sudden 407 responses!), PrivateByte's non-expiring pay-per-GB proxies start at $1.50/GB residential ($0.75/GB datacenter) with $0.50 free starter credit for eligible verified accounts.
