How to Test If a Proxy Is Working (and What to Check)

How to test a proxy properly: curl connection checks, exit IP and geo lookups, ASN type, DNS leaks with socks5h, WebRTC leaks and a copy-paste test script.

Summarize this post with AI

A 22-minute read, or the key points in about 30 seconds, in the assistant you already use.

Opens in a new tab with the prompt filled in. Nothing passes through this site.

Your proxy says "connected" and an IP checker shows a new address. That's how most people test a proxy, and it covers one of the seven things that matter.

It doesn't prove your DNS lookups go through the proxy. It doesn't prove your browser isn't handing out your real IP over WebRTC, or that the "residential" IP you paid for isn't sitting in a data centre. Each of those leaks takes a different path from the one an IP checker sees.

Here's the part most guides skip: one letter in a curl command decides whether your DNS leaks.

Below are the seven checks, the exact commands and what a pass looks like. I haven't run them against a particular provider for this post. Every command comes from the curl, IETF, MDN and vendor docs.

Still choosing what to buy? Start with how a residential proxy works.

Editorial cover showing a laptop sending an amber line through a proxy node to a globe, with a small magnifying glass checking the connection

What does "working" actually mean for a proxy?

A proxy is working when every request leaves from the proxy's IP, in the location and network type you paid for, and nothing else gives your real address away. Each of those claims needs its own test.

CheckWhat it provesToolA pass looks like
ConnectionThe proxy accepts you and forwards trafficcurl -xHTTP 200, no 407
Exit IPSites see the proxy's IP, not yoursipinfo.ioDifferent IP from your baseline
LocationThe IP sits where you paid foripinfo.io and ip-api.comCountry matches your order
Network typeResidential, mobile or datacenterASN lookupISP-type ASN for residential
DNSLookups happen on the proxy sideedns.ip-api.comDNS server isn't your ISP's
WebRTCThe browser doesn't expose your real IPBrowser consoleNo public IP of yours in candidates
Headers and timezoneNothing contradicts the IPhttpbin.org, browserNo forwarded headers, timezone matches

The first three catch broken setups. The last four catch the leaks that get accounts linked and scrapers blocked.

What do you need before you test?

You need four details from your provider: host, port, protocol (HTTP, HTTPS or SOCKS5) and your username and password. You also need a terminal with curl and the browser you'll actually use with the proxy.

Put the proxy in an environment variable so you type it once:

bash
export PROXY="http://USER:PASS@proxy.example.com:8000"
# SOCKS5 with remote DNS (more on the h later):
# export PROXY="socks5h://USER:PASS@proxy.example.com:1080"

The curl man page warns that credentials typed on the command line can briefly show up in process listings. On a shared machine, read them from a file instead. Special characters in a password need URL encoding: %40 for @ and %3a for a colon.

Step 1: Does the proxy connect at all?

Start with one request and ask curl to report what happened:

bash
curl -s -o /dev/null -x "$PROXY" --connect-timeout 10 \
  -w "status=%{http_code} proxy_connect=%{http_connect} connect=%{time_connect}s total=%{time_total}s\n" \
  https://example.com

For an https:// URL, curl asks an HTTP proxy to open a tunnel with a CONNECT request, and http_connect is the proxy's answer to it. A 200 there plus a 200 from the site means you're through. SOCKS proxies don't use CONNECT, so http_connect stays at 000 there. Just read the status.

If it fails, the exit code tells you where. According to curl's man page, exit 5 means the proxy hostname couldn't be resolved, 7 means the connection failed, 28 is a timeout and 97 is a proxy handshake error. A 407 status is Proxy Authentication Required (RFC 9110). Check the username and password first, then, on IP-allowlist plans, whether the provider knows your current IP.

Check the scheme too. With no prefix, or http://, curl treats the proxy as HTTP, so a SOCKS port needs socks5:// or socks5h:// in front of it. Match the scheme to what your provider lists for that port.

Step 2: Did your exit IP actually change?

Take a baseline without the proxy, then repeat the request through it:

bash
curl -s https://ipinfo.io/ip; echo
curl -s -x "$PROXY" https://ipinfo.io/ip; echo

The two addresses must differ. If they match, the request skipped the proxy.

The usual culprit is the environment. curl's -x overrides proxy environment variables, but a NO_PROXY entry that matches the host disables the proxy even when -x is set. Run env and look for NO_PROXY or no_proxy before you blame the provider.

On a rotating pool, run the second line five times. You should see new IPs on a per-request pool and the same IP inside a sticky session window. If that's backwards, recheck the session settings in your username string. My guide to rotating vs sticky proxy sessions explains which one your job needs.

Step 3: Is the IP in the location you paid for?

Ask for the full record instead of the bare IP:

bash
curl -s -x "$PROXY" https://ipinfo.io/json

Without a token, ipinfo returns the IP, city, region, country, coordinates, an org field and a timezone. Check the country first, then the timezone, then the city.

Then get a second opinion, because geolocation databases are built separately and can disagree:

bash
curl -s -x "$PROXY" "http://ip-api.com/json/?fields=query,country,regionName,city,timezone,isp,as,mobile,proxy,hosting"

ip-api's free endpoint needs no key but has limits worth knowing: it only works over plain HTTP, allows 45 requests a minute per IP, and isn't for commercial use. Don't loop it across a big pool.

My rule: a country mismatch is a real problem, so raise it with the provider. A city mismatch between two databases is a question, not proof of a broken proxy. Test against the site you care about before you decide.

Step 4: What kind of IP is it, really?

This is the check that tells you whether "residential" means residential. Every public IP is announced by an autonomous system (AS), and the AS says who runs the network.

Diagram comparing a residential proxy IP traced to a home internet provider network with a datacenter IP traced to a hosting network, found through an ASN lookup
The ASN behind an IP shows whose network it lives on. That's what separates residential from datacenter.

Look at the org field from Step 3. It starts with the AS number and the network's name, like "AS7922 Comcast Cable Communications". A consumer ISP or mobile carrier fits a residential or mobile proxy. A cloud or hosting company means a datacenter proxy, whatever the plan was called.

You can confirm it three ways:

  • ip-api's flags: hosting is true for "hosting, colocated or data center" IPs, mobile for cellular, and proxy for known proxy, VPN or Tor exits.
  • IPinfo's AS type, which labels a network as isp, hosting or business. The per-ASN lookup needs a free token.
  • Team Cymru's IP-to-ASN whois service, which needs no account. Swap in your proxy's IP:
bash
whois -h whois.cymru.com " -v 203.0.113.10"

A residential IP that already shows proxy=true isn't broken, but sites that use similar data may treat it with suspicion. That's worth knowing before you point it at a strict target.

Step 5: Is DNS leaking around the proxy?

A DNS leak happens when the proxy carries your traffic but your own machine still looks up every hostname through your ISP's resolver. The site sees the proxy's IP. Your ISP, and anyone watching the resolver, sees every domain you visit.

With curl, one letter decides this:

Proxy schemeWho resolves the hostnameDNS leak risk
socks4://Your machineYes
socks4a://The proxyNo
socks5://Your machineYes
socks5h://The proxyNo
http:// proxy with an https:// URLThe proxy, via CONNECT host:portNo

That table comes straight from curl's documentation. The man page says --socks5 will "resolve the hostname locally", while --socks5-hostname, the same as socks5h://, lets the proxy do it. For HTTP proxies, RFC 9110 says a CONNECT request carries only the destination host and port, so the name travels to the proxy unresolved.

Diagram of a DNS leak test showing socks5 resolving the hostname on the local machine while socks5h sends the lookup through the proxy
With socks5, your own resolver sees every domain. Add the h and the lookup moves to the proxy.

You can prove it from the terminal. ip-api runs a DNS endpoint that reports which resolver looked up a random hostname:

bash
curl -s -x "$PROXY" "http://$(openssl rand -hex 16).edns.ip-api.com/json"

The dns block shows the resolver's IP and network. If it names your home ISP or your office resolver, your lookups bypass the proxy. Use a fresh random hostname each time, because ip-api caches results for 60 seconds.

Browsers are a separate case. Many now use DNS-over-HTTPS by default, and IVPN's DNS leak test page points out that the browser's chosen DoH provider can itself count as a leak, depending on what you're hiding. Run a browser DNS leak test, such as dnsleaktest.com, with the proxy on.

Step 6: Is WebRTC exposing your real IP?

WebRTC powers video calls in the browser, and by default it doesn't follow your proxy settings. RFC 8828, the IETF document on WebRTC IP handling, says it plainly: if you're behind a proxy but direct internet access is allowed, WebRTC's STUN checks "will bypass the proxy and reveal the public IP address of the client."

Diagram of a WebRTC leak where browser traffic goes through a proxy while a STUN request takes a direct path that reveals the real IP
The page loads through the proxy. The STUN request doesn't, unless you tell the browser otherwise.

To test it yourself, open DevTools on any page while the proxy is on and paste this into the console:

js
const pc = new RTCPeerConnection({ iceServers: [{ urls: "stun:stun.l.google.com:19302" }] });
pc.createDataChannel("test");
pc.onicecandidate = (e) => { if (e.candidate) console.log(e.candidate.type, e.candidate.address); };
pc.createOffer().then((o) => pc.setLocalDescription(o));

It uses the same public STUN server as the WebRTC project's own Trickle ICE sample, which shows the same candidates in a page if you'd rather not touch the console.

MDN defines the candidate types. A host candidate is a local address, and browsers that follow the IETF mDNS proposal hide it behind a random name ending in .local. A srflx (server reflexive) candidate is the public address a STUN server saw.

If a srflx address matches your real IP from Step 2's baseline, you have a WebRTC leak.

The fix depends on the browser:

  • Chrome: the WebRtcIPHandling enterprise policy set to disable_non_proxied_udp makes WebRTC use TCP on the public interface and UDP only through a proxy that supports it.
  • Firefox: in about:config, set media.peerconnection.ice.proxy_only_if_behind_proxy to true. Mozilla notes that media.peerconnection.ice.proxy_only breaks WebRTC whenever no proxy is set.
  • Anti-detect browsers usually let you set WebRTC per profile. Check that setting before anything else.

The catch: RFC 8828 notes that HTTP proxies and most SOCKS proxies can't carry UDP, so forcing WebRTC through them falls back to TCP with worse call quality. For scraping with curl or Python, none of this applies. There's no browser, so there's no WebRTC. DNS is your leak to watch.

Step 7: Do the headers and timezone tell the same story?

Some proxies announce themselves. Plain HTTP proxies can add headers like Via or X-Forwarded-For, and MDN describes X-Forwarded-For as the header that identifies the originating IP of a client behind a proxy. In other words, yours. Check what a site receives:

bash
curl -s -x "$PROXY" http://httpbin.org/headers

Use the http:// URL on purpose. Over https://, curl's documentation explains, a CONNECT tunnel stops the proxy from seeing or changing the traffic, so a header check there will always look clean.

In the browser, compare your system timezone with the IP's. Type Intl.DateTimeFormat().resolvedOptions().timeZone into the console. If it says Asia/Kolkata while ipinfo puts your IP in America/Chicago, a site can see the mismatch. It's one of the signals covered in how browser fingerprinting works.

What usually goes wrong when you test a proxy?

Most failed tests come down to a handful of mistakes, and most of them aren't the provider's fault:

  • Testing in one app and using another. curl going through the proxy says nothing about your browser, Python script or n8n node. Test where the traffic really runs.
  • Using socks5:// when you meant socks5h://. The IP check passes, and the DNS check fails.
  • A forgotten NO_PROXY or a system proxy setting that quietly overrides what you configured.
  • Judging the proxy by a single IP from a rotating pool. Sample several.
  • Reading a block as a broken proxy. Shared IPs carry other people's history, which is why Google shows CAPTCHAs to VPN and proxy users even when the setup is perfect.
  • Hammering free lookup APIs in a loop and getting rate-limited, then blaming the proxy for the 429s.

A copy-paste script for every new proxy

This runs the terminal checks from Steps 2 to 5, plus the header check from Step 7, in one go. Set PROXY first, then read each block against the pass criteria above.

bash
#!/usr/bin/env bash
# proxy-check.sh - usage: PROXY="socks5h://USER:PASS@proxy.example.com:1080" ./proxy-check.sh
set -u
: "${PROXY:?Set PROXY first}"

echo "== Baseline IP (no proxy)"
curl -s --max-time 15 https://ipinfo.io/ip; echo

echo "== Exit IP, location and org (through proxy)"
curl -s --max-time 20 -x "$PROXY" https://ipinfo.io/json; echo

echo "== Network type flags (ip-api)"
curl -s --max-time 20 -x "$PROXY" "http://ip-api.com/json/?fields=query,country,city,timezone,isp,as,mobile,proxy,hosting"; echo

echo "== Who resolved DNS"
curl -s --max-time 20 -x "$PROXY" "http://$(openssl rand -hex 16).edns.ip-api.com/json"; echo

echo "== Headers the site received"
curl -s --max-time 20 -x "$PROXY" http://httpbin.org/headers; echo

It won't catch WebRTC or timezone problems. Those live in the browser, so run Step 6 and Step 7 there.

Frequently asked questions

How do I check if a proxy is working with curl?▾
Run curl -s -x "$PROXY" https://ipinfo.io/ip and compare it with the same command without -x. Different IPs mean the request went through the proxy. Add -w with http_code and http_connect to see where a failure happens.
Why does my proxy show the right IP but the wrong city?▾
Geolocation databases are built separately and can disagree, most visibly at city level. Check the country and timezone in two lookups, such as ipinfo and ip-api. If the country is wrong in both, contact your provider. If only the city differs, test on the site you actually care about.
How can I tell if a proxy is residential or datacenter?▾
Look up the ASN behind the proxy's IP. A consumer ISP or mobile carrier fits residential or mobile. A cloud or hosting company means datacenter. ip-api's hosting flag and IPinfo's AS type field give you a quick second opinion.
What is the difference between socks5 and socks5h?▾
With socks5://, curl resolves the hostname on your machine, so your own DNS resolver sees every domain. With socks5h://, the proxy resolves it. If you care about DNS leaks, use socks5h.
Do I need to worry about WebRTC leaks when scraping?▾
Not with curl, Python requests or similar HTTP clients, because they don't run WebRTC. It matters in real browsers, including headless browsers and anti-detect profiles. For scripts, the DNS check is the one to run.
Is it safe to paste my proxy into an online proxy checker?▾
You're handing your proxy credentials to a third party, and anyone holding them can spend your bandwidth. Testing from your own terminal with the commands above avoids that. If you do use an online checker, rotate the password afterwards.
How often should I test a proxy?▾
Test every new proxy or plan before real work, and again whenever you change apps, browsers or settings. On rotating pools, sample a few IPs at the start of each big job, since the pool behind the endpoint changes over time.

If you only run one test today, make it the DNS check with socks5h. It's the leak an IP checker will never show you. And if a "residential" proxy fails the network type check, it isn't what you paid for. That's the moment to compare providers.

Share