Proxy code examples
Enter the connection details. The code reads your username and password from environment variables, so they never end up in a script.
Before you run the code
Put your credentials in the environment, not in the script:
export PROXY_USER="your-username"
export PROXY_PASS="your-password"
That way they stay out of your repository and your shell scripts. To add targeting, set PROXY_USER to a username with options, such as USERNAME-country-DE. The URL generator shows the format.
Notes on the examples
- All of them keep TLS certificate checks on. Do not turn them off to silence a proxy error.
- The Python SOCKS5 example needs the socks extra:
pip install "requests[socks]". - The Node.js HTTP example uses undici's ProxyAgent, and the SOCKS5 example uses socks-proxy-agent.
- The default target shows the IP address the request came from, which proves the proxy is in use.
Questions
Why does the tool not ask for my password?
It does not need one. The code reads credentials when it runs, so nothing sensitive has to pass through this page.
Can I use SOCKS5 with Playwright?
Chromium does not support SOCKS5 with a username and password, so use the HTTP proxy with Playwright.
Get credentials for these examples on the pricing page.