# How to test a proxy before using it

> How to test a proxy before using it: read its IP twice, prove it carries HTTPS, time it and check its DNS, all with curl, then test it again later.

Source: https://mosaicbrowser.com/guides/test-a-proxy-before-using-it

## How to test a proxy before using it

Send two requests through the proxy to an IP lookup and compare the IPs, fetch an HTTPS page to prove it carries HTTPS, time a few requests, and look up which DNS resolver the IP uses. Then repeat the test later, because one passing run is one sample of a proxy that can rotate or die.

![Test it twice before an account goes near it, beside a screenshot: a proxy check result in Mosaic: latency, IP address, ISP, HTTPS support and reputation](https://mosaicbrowser.com/covers/test-a-proxy-before-using-it.webp)

To test a proxy before using it, send a request through it twice and compare the IP addresses, fetch an HTTPS page through it, time a handful of requests, and find out which DNS resolver its IP uses. That takes five minutes with `curl`. The part most tests skip is the second reading: a proxy that answers once has told you about one connection, and the account you put behind it will make thousands.

What follows is the test we run, the commands for doing it by hand, and the four results that surprised us while we built the same test into Mosaic. The list of what to look at (location, blocklists, residential or not, leaks inside the browser) is in [how to check a proxy before you use it](https://mosaicbrowser.com/guides/how-to-check-a-proxy-before-you-use-it); this page is about running the test so its answer means something.

## Test 1: does it carry HTTPS?

Almost every page an account loads is HTTPS, and an HTTP proxy carries HTTPS with the `CONNECT` method: it opens a connection through the proxy and then forwards bytes blindly in both directions ([RFC 9110, section 9.3.6](https://www.rfc-editor.org/rfc/rfc9110#section-9.3.6)). A gateway can answer plain HTTP and refuse `CONNECT`. Test with an HTTPS address, never a plain one:

```
curl -x http://USER:PASS@HOST:PORT https://www.cloudflare.com/cdn-cgi/trace

```

A pass prints a few lines, including `ip=` with the IP address and `loc=` with its country. For a SOCKS5 proxy write `socks5h://` instead of `http://`; the `h` makes curl send the hostname to the proxy instead of looking it up on your own computer, which is how a browser behind it should behave too.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Checked before every launch](https://mosaicbrowser.com/features/proxy-check-before-launch)

## Test 2: does the IP hold still?

Run the same command again, and once more a minute later. Then read the IP from a second service so you are not trusting one database:

```
curl -x http://USER:PASS@HOST:PORT "http://ip-api.com/json/?fields=query,country,city,timezone,isp,mobile,proxy,hosting"

```

ip-api's free endpoint is plain HTTP only, allows 45 requests a minute, and its documentation says it is not for commercial use ([ip-api docs](https://ip-api.com/docs/api:json), read 2 November 2026). Its `hosting` flag is the one that marks a datacentre address.

If the addresses differ between runs, the proxy rotates. That is fine for scraping and fatal for a signed-in account, because the profile claims one timezone while its traffic comes from several places. When we first pointed our own check at a rotating residential endpoint it answered Peru, Brazil and Bahrain on three requests in a row. Add a session id to the username in your seller's spelling and test again; [rotating vs sticky proxies](https://mosaicbrowser.com/guides/rotating-vs-sticky-proxies) has the spellings for Oxylabs, Bright Data and IPRoyal.

One trap here caught us. A home connection often has both an IPv4 and an IPv6 address, and two requests can leave by different families. We had a sticky session flagged as rotating three checks in a row because one service saw `172.115.91.44` and the other saw an IPv6 address from the same home. Compare two IPv4 readings, or two IPv6 readings, never one of each.

## Test 3: how fast, and how steady?

Time five requests and look at the spread, not the best one:

```
for i in 1 2 3 4 5; do curl -s -o /dev/null -w "%{time_connect} %{time_total}\n" -x http://USER:PASS@HOST:PORT https://www.cloudflare.com/cdn-cgi/trace; done

```

`time_connect` is the hop to the gateway; `time_total` includes the trip on through the proxy's IP to the site. A residential IP is somebody's home connection, so a second or two is normal. Ten seconds on one request out of five is the number to write down, because that is what a login page will meet.

## Test 4: whose DNS answers?

A proxy that carries your pages can still leave the name lookups to your own computer. Through the proxy, ask a service that reports which resolver looked it up:

```
curl -L -x http://USER:PASS@HOST:PORT http://edns.ip-api.com/json

```

It redirects to a one-time subdomain and reports the resolver that fetched it. In one of our own measurements, through a US residential session whose IP was a Verizon address, three requests reported three Google resolvers in Germany and the Netherlands, while the same request from this machine directly reported our own ISP in Austria. Both facts matter: the lookup went through the IP, and the IP's resolver is not where the IP is.

## Test 5: test it again, on a different session

Residential pools hand out a dead IP some of the time. The seller's gateway may answer `400`, `502` or `504`. A 504 means a gateway "did not receive a timely response from an upstream server" ([RFC 9110, section 15.6.5](https://www.rfc-editor.org/rfc/rfc9110#section-15.6.5)), and on a residential pool that upstream is one person's connection.

We hunted for one on purpose: forty fresh sessions at one seller, and the twenty-ninth was dead. Retried three more times on the same session id, it answered 504 all four times. Most fresh session ids on the same gateway answered 200 (one more fresh one was unlucky too). So a failed test is a reason to change the session id and test again, and a pass is a reason to test again tomorrow, since the session behind it can end.

## Test a proxy before using it: what a pass looks like

| Test | Pass |
| --- | --- |
| HTTPS | an HTTPS request returns an address |
| IP | the same address on two requests of the same family, in the country you need |
| Speed | five requests, none far slower than the rest |
| DNS | the resolver is reached through the IP, not through your ISP |
| Again | the same result later, or a new session that passes all of the above |

## How Mosaic runs the same test

We built these tests into Mosaic because people run them once and then trust the result for months. Each check reads the IP over two connections, proves HTTPS works through the proxy with Cloudflare's trace endpoint, records the round trip, and reads the resolver through the IP. Checking a saved proxy also looks its IP up on six public blocklists. A transport failure is retried, and on a proxy made from a provider the retry uses a different session, not the one that just failed.

![A proxy check result in Mosaic: latency, IP address, ISP, HTTPS through the proxy and reputation](https://mosaicbrowser.com/shots/proxy-check.png)
*One check: IP, latency, HTTPS and reputation*

Then it runs the check again before every launch, and a profile does not open behind a proxy that has not answered and connected. What the launch gate refuses, and the reason it gives, is on [the proxy check before launch](https://mosaicbrowser.com/features/proxy-check-before-launch) page.

## Sources

1. [ip-api: JSON endpoint documentation](https://ip-api.com/docs/api:json), read November 2, 2026
2. [RFC 9110: HTTP Semantics (CONNECT, 504 Gateway Timeout)](https://www.rfc-editor.org/rfc/rfc9110), read November 2, 2026

## Questions

### What is the quickest way to test a proxy?

One curl command through it to an HTTPS address that prints your IP. If an address comes back, the proxy accepted your login and carried an encrypted connection. It does not tell you whether the IP holds still, so run it a second time and compare.

### Why did my proxy pass the test and fail an hour later?

Residential and mobile IPs are other people's connections, and sessions end. A seller can move your session to a new IP, or the IP can stop answering. A test is true for the moment it ran, which is why Mosaic checks again before every launch.

### Is a 504 from a residential proxy a dead proxy?

Usually it is one dead session, not a dead gateway. On one pool we measured, the same session id failed four times in a row while fresh session ids on the same gateway answered. Change the session id before you give up on the seller.

### Do I need to test DNS separately?

Yes, if the browser will use it. A proxy can carry your pages while your own computer still looks the hostnames up through your ISP. Testing the resolver tells you whose resolver answers when you go through the IP.

## Related

[How to check a proxy before you use it](https://mosaicbrowser.com/guides/how-to-check-a-proxy-before-you-use-it): Check that a proxy answers and connects, where its IP really is, whether the address is residential or blocklisted, and that the browser stays behind it.

[Check the proxy before launching a browser profile, every time](https://mosaicbrowser.com/features/proxy-check-before-launch): Mosaic checks the proxy before launching a browser profile: it must answer and carry HTTPS. If it does not, nothing opens and the error names the proxy.

[Rotating vs sticky proxies: which one an account needs](https://mosaicbrowser.com/guides/rotating-vs-sticky-proxies): Rotating vs sticky proxies: rotating changes the public IP per connection, sticky keeps one for a session you name. Logged-in accounts need sticky.

[Residential vs datacenter vs mobile proxies](https://mosaicbrowser.com/guides/residential-vs-datacenter-vs-mobile-proxies): Residential vs datacenter vs mobile proxies: server networks, home ISPs or cellular carriers. IP databases label each kind, and sites read the label.

[Residential proxy: an IP on a home internet connection](https://mosaicbrowser.com/glossary/residential-proxy): A residential proxy sends your traffic out through an address an ISP assigned to a home connection, so sites see a household rather than a data center.







[How to check if a proxy is residential](https://mosaicbrowser.com/guides/check-if-a-proxy-is-residential): How to check if a proxy is residential: look up the public IP, not the gateway. The hosting flag, network owner and reverse DNS tell a home ISP from a server.

## Run this guide on your own accounts

Every Mosaic profile is a fingerprint, a proxy IP and a cookie jar that agree with each other, kept on your computer. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
