Getting started29 September 20267 min read

How to use a proxy: the four values and your first request

How to use a proxy from zero. Where the host, port, username and password live, a first request in curl and Python, and the three errors of day one.

How to use a proxy, in short: give your tool four values, a host, a port, a username and a password. The tool sends its requests to that host and port, logs in with the username and password, and the proxy forwards the request so the site sees the proxy's IP address instead of yours. Everything else is detail on top of those four values.

This guide takes you from a fresh account to a request you can prove went through the proxy, then points you at the setup guide for the tool you use.

The four values, and where to find them

Every HTTP proxy connection needs the same four things:

  • Host. The address of the proxy server your tool connects to.
  • Port. The number on that server your connection goes to.
  • Username and password. How the proxy knows the traffic is yours and which balance to bill.

In our dashboard they are on the service page. Each service you buy lists its own host, port, username and password there, ready to copy. There is no single gateway address shared by everyone, so every code sample on this site writes HOST, PORT, USERNAME and PASSWORD where your own values go.

A few things differ by product:

  • On a residential service you get one set of values, and the dashboard setting decides whether you get a new IP per request or keep one for a while (more on that below).
  • On ISP and datacenter services, the page lists each IP you rented with its own port and login. Each one is a separate proxy.

Most tools want the four values joined into one proxy URL:

http://USERNAME:PASSWORD@HOST:PORT

The http:// at the front is the protocol spoken to the proxy. Keep it as http:// even when the sites you visit are https://. For an HTTPS site, your tool asks the proxy to open a CONNECT tunnel, and the encrypted connection runs through it end to end. SOCKS5 works too: residential ports answer both, and ISP and datacenter proxies switch in the dashboard. Tools that support it take socks5h:// here; HTTP vs SOCKS5 says when to use which.

How to use a proxy for your first request

Whatever tool you end up with, the way to set up a proxy starts the same: the smallest possible test. Ask an IP echo service what address it sees. api.ipify.org returns your public IP as plain text, nothing else.

With curl

First, without the proxy, so you know your own address:

curl -s https://api.ipify.org

Then through it:

curl -s -x http://USERNAME:PASSWORD@HOST:PORT https://api.ipify.org

The two numbers should differ. If your password contains symbols such as @, : or #, pass the login separately so curl does not have to parse it out of the URL:

curl -s -x http://HOST:PORT -U "USERNAME:PASSWORD" https://api.ipify.org

The curl guide covers the rest: environment variables, verbose output for debugging, and config files.

With Python

The requests library takes a dictionary that maps each scheme to a proxy URL. Both entries point at the same http:// proxy:

import requests

PROXY = "http://USERNAME:PASSWORD@HOST:PORT"
proxies = {"http": PROXY, "https": PROXY}

mine = requests.get("https://api.ipify.org", timeout=30).text
via_proxy = requests.get("https://api.ipify.org", proxies=proxies, timeout=30).text

print("my IP:     ", mine)
print("proxy exit:", via_proxy)
print("changed" if mine != via_proxy else "NOT changed: check the proxies argument")

If your password has special characters, encode it before building the URL with urllib.parse.quote(password, safe=""). The Python requests guide has sessions, retries and async versions.

How to check the IP changed

The script above already compares the two addresses. Three more checks are worth a minute on day one:

  1. Run it several times. On a residential service set to Randomize IP, each run should print a different exit IP. On Sticky IP, or on an ISP or datacenter IP, it should print the same one every time.
  2. Check the IP's owner. An echo tells you the address, not what kind of network it belongs to. Checking what kind of IP you were sold shows how to look up the network behind it with free tools.
  3. Look at your usage log. The request you made shows up in the dashboard with its host, status code and byte count. Seeing your own test there is a good way to learn to read the meter before a real job runs.

Residential, ISP or datacenter?

Buy the cheapest one that works: if the site loads fine and you only need a different location, rent a datacenter IP, and if you get captchas, empty pages or instant blocks, residential is the one to try. If a login needs the same address for weeks, an ISP IP keeps it for you; residential or datacenter walks through the choice in more detail.

Rotating or sticky?

A rotating setup gives you a new exit IP on every request, which spreads a big job across many addresses and is what you want for most scraping. A sticky setup keeps one IP for a stretch, which you need when a site ties a login or a cart to your address. On our residential line you choose Randomize IP or Sticky IP in the dashboard, and for sticky the dashboard builds a credential with a session ID in it that you copy as shown. ISP and datacenter IPs are static, so they are sticky by nature, and if you want rotation you cycle through your own list. Rotating vs sticky proxies covers when each one fits.

Next: set up the tool you use

Once the echo test works, move the same four values into your real tool. Each guide below covers one tool, step by step:

The full list, including Scrapy, Playwright, Puppeteer and Node.js, is on the setup guides page.

The three errors you will meet first

407 Proxy Authentication Required

The proxy answered, but it did not accept the login. Nearly always it is a mistyped or truncated password, a leftover space from copying, or a symbol that needed encoding in the URL. Copy the values again from the service page and try the -U form of the curl command above. Fixing a 407 goes through every cause we see.

Timeouts

Nothing came back in time. If every request times out, suspect the connection to the proxy: a wrong host or port, a firewall or office network that blocks the outbound port, or a service that has ended. If only some time out, the exit or the target is slow, and a residential exit on someone's home connection can take longer than your default timeout allows. Proxy timeout errors separates the two.

Blocked, with a captcha or a 403

The proxy worked and the site refused you. That is about the target's defences, not your setup. Slow down, check your headers, and consider whether this site needs a residential IP. Why your scraper started getting blocked has the checklist.

On our meter, connection failures (timeouts, resets, and errors from our own gateway such as a 407 or a 502) are billed at zero and still shown, marked free, so a first setup that cannot connect or log in does not eat your balance. A captcha or a 403 page is a response from the site, and its bytes count as traffic. The details are under metering on the honesty page.

Quick answers

Do I need special software to use a proxy? No. Most tools that make web requests accept a proxy URL: curl, Python, Node, browsers, and the operating system settings on Windows, macOS, Android and iPhone.

Why do I use http:// for an https:// site? The scheme describes how your tool talks to the proxy. HTTPS traffic travels through a CONNECT tunnel inside that connection and stays encrypted between you and the site.

Is the IP the same every time? Depends on the product. Residential on Randomize IP changes per request; Sticky IP, ISP and datacenter keep one address.

Does a proxy make me anonymous? It changes the IP address a site sees. Cookies, logins and your browser's fingerprint can still identify you, so treat a proxy as a different address and nothing more.

Start with a small top-up, run the echo test, and move up from there; current rates are on the pricing page. If a step does not behave as described, paste the command and the error in Discord and someone will spot it.

Got a follow-up question?

Ask it in Discord. The answer helps whoever reads the thread next.

Join the Discorddiscord.gg/proxypanda
Start with $5Ask in Discord