Code and automation with proxies
Libraries and languages: Python, Node.js, Go, PHP, Java and more. 25 guides.

Proxy in Puppeteer
How to run Puppeteer through a proxy with login and password in two lines of code. At the end the script prints the IP the site sees.
Proxy in Playwright
In Playwright a proxy with a password is one object in launch. Below is Python code and the same thing in Node.js.
Proxy in Scrapy
Scrapy works with proxies without third-party packages. Here is a spider that goes through a password proxy and prints the IP.
Proxy in Python requests
In requests a proxy is a proxies dict per request or per session. Here are HTTP and SOCKS5 variants with a password.
Proxy in cURL
cURL is the fastest way to check that a proxy works. Below are commands for HTTP and SOCKS5 with a password.
Proxy in Node.js
Node.js's built-in fetch doesn't pick up a proxy by itself; you need an agent. Here is undici ProxyAgent for HTTP and agents for axios, including SOCKS5.
Proxy in Python httpx
In httpx a proxy is one string in the proxy parameter. Here are HTTP and SOCKS5 with a password, plus the errors after upgrading to 0.28.
Proxy in aiohttp
In aiohttp an HTTP proxy is passed in the proxy parameter right in the request. SOCKS5 needs a separate connector. Both variants are below.
Proxy in urllib3
urllib3 has a quirk: ProxyManager doesn't take the login from the proxy URL. Here is how to pass it correctly.
Proxy in Python urllib
When you can't install packages, urllib.request is enough. Here is how to send a request through an HTTP proxy with a password.
Proxy in Go net/http
The standard net/http handles both HTTP and SOCKS5 with a password. You just set the proxy URL in the Transport.
Proxy in PHP cURL
In PHP cURL a password proxy takes three options. Below is a script for HTTP and a one-line switch to SOCKS5.
Proxy in Guzzle
In Guzzle a proxy is the proxy option with a string that already holds the login and password. Here is a client that prints the IP.
Proxy in Java HttpClient
In Java a password proxy breaks on HTTPS sites because of one system property. Here is how to set up HttpClient properly.
Proxy in C# HttpClient
In .NET a password proxy is set through WebProxy and an HttpClientHandler. Below is a console app that prints the IP.
Proxy in Ruby Net::HTTP
In Net::HTTP the proxy goes in as positional arguments to start. Here is the order that gets the login to the proxy.
Proxy in Rust reqwest
In reqwest the proxy is attached in the client builder. Here is HTTP with basic_auth and a one-line switch to SOCKS5.
Proxy in wget
wget has no option for the proxy address, but you can set it with -e or an environment variable. Ready commands below.
Proxy in Postman
Postman can send requests through your own password proxy. Here is where the setting lives and how to check the IP.
Proxy in Crawlee
In Crawlee a proxy is one ProxyConfiguration object that every crawler understands. Here is an HttpCrawler that prints the IP.
Proxy in undetected-chromedriver
undetected-chromedriver has no setting of its own for a proxy login. Here is a working workaround with a local relay, and its limits.
Proxy in SeleniumBase
SeleniumBase handles proxy auth for Chrome by itself. You just pass a LOGIN:PASSWORD@HOST:PORT string.
Proxy in nodriver
In nodriver a password proxy is set when creating a browser context. The library spins up a local auth relay by itself.
Proxy in Botasaurus
In Botasaurus the proxy goes right into the @browser decorator. The library handles the login and password itself, but it needs Node.js for that.
Proxy in n8n
In n8n a proxy is set in the HTTP Request node options or globally with environment variables. Both are covered here.
Nothing found. Message the bot and we will add a guide.
Need proxies for your software?
Residential proxies from $0.6 per GB, mobile and VIP. Country and city, rotation or sticky session, HTTP and SOCKS5. 1 GB free to try.