---
title: "How to Check Your Proxy's Exit IP: IP Echo Services"
description: "Send a request through the proxy to an IP echo URL; the address it returns is your exit IP. ipify, httpbin and icanhazip compared, plus IPv6 and pooling traps."
url: https://proxynet.io/blog/proxy-egress-ip-check-api
date: 2026-12-01
author: "Acar Diveroli"
category: "Proxies"
lang: en
---

# How to Check Your Proxy's Exit IP: IP Echo Services

The exit IP (egress IP) is the address a request sent through a proxy shows to the target site. The quick way to see it is an IP echo service. The service writes the address the connection came from back into its response. The trap sits in the connection layer: on a rotating proxy every new connection gets a different address, while a connection pool keeps showing the same one. This post covers how echo services differ, their IPv6 variants, rotation and pooling behavior, and how to run your own echo endpoint.

> **Note: Short answer**
>
> Send a request through the proxy to an echo URL such as `https://api.ipify.org`; the address it returns is your exit IP. On a rotating proxy each new connection shows a different address, and requests on the same connection show the same one.

## The address the echo service sees

An echo service reads the source address of the TCP connection it receives and writes it into the response. When you use a proxy, that connection is opened by the proxy's exit point, not by you. So the address the service sees is the exit IP.

The address you connect to and the exit address are usually different. You connect to `pr.proxynet.io:8000`. The gateway forwards the request from an exit in the pool. The target site sees only that exit. What a site infers from this address, such as provider and location, is covered in [what websites learn from your IP address](/blog/what-websites-learn-from-ip).

The shortest check is one line:

```bash
curl -x http://user:pass@pr.proxynet.io:8000 https://api.ipify.org
```

If the response shows your own home or office address, the request never went to the proxy.

## Services and response formats

All echo services do the same job, but their response formats differ. The difference shows when a script reads the output. The table below reflects requests we sent from our own line on December 1, 2026.

| Endpoint | Response | Trailing newline | With `X-Forwarded-For` sent |
|---|---|---|---|
| `api.ipify.org` | Plain text, `{"ip": …}` with `?format=json` | No | Returned the header's address |
| `httpbin.org/ip` | JSON, `origin` field | Yes | Header and real address, comma-separated |
| `icanhazip.com` | Plain text | Yes | Ignored the header |
| `ifconfig.me/ip` | Plain text | No | Ignored the header |
| `checkip.amazonaws.com` | Plain text | Yes | Returned the header's address |

The trailing newline is a small but annoying detail. When we called `api.ipify.org` three times in a loop, the three addresses were printed stuck together on one line. Add `curl -w '\n'` in loops, and use `.text.strip()` in Python.

The last column matters more. `X-Forwarded-For` is an HTTP header that claims to carry the client's address, and anyone can write it. In our test, two services returned a made-up address from this header instead of the TCP address. If a proxy adds such a header to a plain `http://` request, the echo service may show the header's value instead of the exit IP.

So call the echo URL over `https://`. With HTTPS, the proxy only opens a `CONNECT` tunnel and cannot touch the headers of the encrypted request. If you use a service that reads the header, compare its result with a service that reads the socket, such as `icanhazip.com`.

## IPv4 and IPv6 variants

IPv4 and IPv6 addresses are queried on different domains. The service returns whichever address family the connection arrived on. The domain's DNS records decide the family of the connection.

| What you want to see | ipify | icanhazip |
|---|---|---|
| IPv4 only | `api.ipify.org` | `ipv4.icanhazip.com` |
| IPv6 only | `api6.ipify.org` | `ipv6.icanhazip.com` |
| Whichever is in use | `api64.ipify.org` | `icanhazip.com` |

An IPv6-only address fails if the exit has no IPv6. On our IPv6-less line, curl stopped with code `6` for `api6.ipify.org` and `ipv6.icanhazip.com`, and `api64.ipify.org` returned the IPv4 address. When you query through a proxy, what counts is the IPv6 support of the proxy's exit, not of your own line.

curl's `-4` and `-6` flags are misleading here. They only pick the family used to connect to the proxy. In our test, with `-6` curl could not connect to a local proxy listening on IPv4 only (code `7`). The family of the exit is set by the domain you query, not by a flag.

## Rotation and connection pooling

On a rotating proxy, the exit is chosen when the connection opens. For an HTTPS request, that moment is when the `CONNECT` tunnel is set up. As long as the tunnel stays open, every request leaves from the same exit. To see a new IP on every request, you need a new connection for every request. The product side of this behavior is on the [Rotating Proxy](https://proxynet.io/rotating-proxy) page.

curl opens a new connection each time it runs. On a rotating gateway, this loop shows three different addresses:

```bash
for i in 1 2 3; do
  curl -s -w '\n' \
    -x http://user:pass@pr.proxynet.io:8000 \
    https://api.ipify.org
done
```

HTTP libraries, on the other hand, keep connections in a pool and reuse them. In Requests, `requests.get` opens a new connection on every call. `requests.Session` keeps the connection to the same host:

```python
import requests

PROXY = "http://user:pass@pr.proxynet.io:8000"
proxies = {"http": PROXY, "https": PROXY}
ECHO_URL = "https://api.ipify.org?format=json"

def exit_ip(client=requests):
    r = client.get(ECHO_URL, proxies=proxies, timeout=(5, 10))
    r.raise_for_status()
    return r.json()["ip"]

# Each call opens a new connection: three different addresses on rotation
print([exit_ip() for _ in range(3)])

# Session reuses the tunnel: the same address three times
with requests.Session() as s:
    print([exit_ip(s) for _ in range(3)])
```

Don't forget the `https` key in the `proxies` dict. In our test, with only the `http` key set, the `https://` request skipped the proxy entirely and raised no error.

In Node.js, the built-in `fetch` has no proxy option. Use the `ProxyAgent` class from the `undici` package (`npm install undici`). The same agent shares the tunnel:

```js
import { fetch, ProxyAgent } from "undici";

const agent = new ProxyAgent("http://user:pass@pr.proxynet.io:8000");

for (let i = 0; i < 3; i++) {
  const res = await fetch("https://api.ipify.org?format=json", { dispatcher: agent });
  console.log((await res.json()).ip);
}
await agent.close();
```

In our test, this loop sent all three requests through one tunnel. Creating a new `ProxyAgent` for each request opened three tunnels. If a rotating proxy keeps showing the same address, the problem is most likely the pool, not the proxy.

## Country data and rate limits

The address from an echo service is a measurement; the country is an estimate. Country and city come from looking the address up in a geo-IP database. Databases draw on different sources and can show different countries for the same address. The reasons for this gap are covered in [how accurate IP geolocation is](/blog/ip-geolocation-accuracy).

Two rules are enough when checking the country. Take the address from the echo service and the country from a separate database. If the result differs from what you expect, check a second database. You usually can't know which database the target site uses.

Free services don't have unlimited capacity either. ipify states on its own page that it has no usage limit. Other services may slow requests down under heavy traffic or return `429`. Check the exit at the start of a session and when something looks off, not on every request. If you check many proxies in bulk, cap the concurrency. We showed the setup in [building an async proxy checker in Python](/blog/async-proxy-checker-python).

## Your own echo endpoint

If you check often, run your own echo endpoint. A few lines of server code are enough, and the rate limit is in your hands. This Node.js server looks at the socket's source address, not at headers:

```js
// echo.mjs — returns only the source address of the TCP connection
import http from "node:http";

const server = http.createServer((req, res) => {
  // Reads the socket itself, not headers: X-Forwarded-For is ignored
  const ip = req.socket.remoteAddress.replace(/^::ffff:/, "");
  const json = new URL(req.url, "http://x").searchParams.get("format") === "json";
  res.setHeader("Cache-Control", "no-store");
  if (json) {
    res.setHeader("Content-Type", "application/json");
    res.end(JSON.stringify({ ip }));
  } else {
    res.setHeader("Content-Type", "text/plain");
    res.end(ip + "\n");
  }
});

server.listen(Number(process.env.PORT ?? 8080), process.env.HOST ?? "0.0.0.0");
```

Start it with `node echo.mjs` and call your server's public address through the proxy. The `::ffff:` prefix is how an IPv4 connection appears on an IPv6 socket. The code strips it.

If you put the server behind a reverse proxy or CDN, the socket address becomes the address of that intermediate layer. In that case you need to read the `X-Forwarded-For` list. Trust only its right-hand end, the address your own intermediate layer added. The client can write the values on the left itself.

## Troubleshooting

If the echo result is not what you expect, start with this table:

| Symptom | Likely cause | What to do |
|---|---|---|
| Your own IP shows up | The request never reached the proxy | Check the `https` key and `NO_PROXY` |
| Same IP on rotation | Connection pool | Open a new connection for each check |
| Addresses stuck together | No trailing newline | `-w '\n'` or `.strip()` |
| IPv6-only address fails | No IPv6 at the exit | Try the `api64` variant |
| `407` | Credentials rejected | Encode special characters in the password |
| `429` | Echo service rate limit | Space out checks or run your own endpoint |
| Unexpected address | Service trusts the header | Query over `https://` and with a second service |

If every check times out, the problem is the proxy connection, not the echo service. Run the same command without the proxy first. If it works without the proxy, go back to the address, port and credentials.

## How we tested

We ran the tests on December 1, 2026, on Windows 11, with curl 8.23.0, Python 3.13.17 with Requests 2.34.2, and Node.js 24.22.2 with undici 8.10.0. We queried the public services directly from our own IPv6-less line on the same day to check their response formats and `X-Forwarded-For` behavior.

To observe rotation, we wrote a local HTTP proxy that requires Basic authentication. It forwarded each new client connection from the next loopback address in turn (127.0.0.2, 127.0.0.3, 127.0.0.4). The target was the `echo.mjs` server from this post. Separate `requests.get` calls showed three addresses, `Session` showed one. On the HTTPS path, we counted the `CONNECT` tunnels the proxy opened: `Session` and the shared `ProxyAgent` opened one tunnel each.

## The bottom line

Check the exit IP with an `https://` echo URL, from a service that reads the socket. When testing rotation, open a new connection for each check; for jobs that need to keep the same address, use a [Sticky Proxy](https://proxynet.io/sticky-proxy). Above all, look at whether the echo shows your own address: a request that never reaches the proxy raises no error.

## Sources

- [ipify, API usage and IPv4/IPv6 endpoints](https://www.ipify.org/): ipify.org
- [X-Forwarded-For header, Security and privacy concerns](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-For): developer.mozilla.org
- [RFC 7239, Forwarded HTTP Extension](https://www.rfc-editor.org/rfc/rfc7239): rfc-editor.org
- [Requests Advanced Usage, Session Objects](https://requests.readthedocs.io/en/latest/user/advanced/#session-objects): requests.readthedocs.io

## Frequently asked questions

### Is the exit IP the same as the proxy address I connect to?

No, usually not. You connect to the gateway's address, for example `pr.proxynet.io:8000`. The gateway forwards the request from an exit in the pool, and the target site sees only that exit. So resolving the proxy's address does not tell you the exit IP. The way to see the exit is to send the request through the proxy to an echo service.

### Which IP echo service should I use?

For scripts, `api.ipify.org?format=json` or `icanhazip.com` is enough. The first returns JSON; the second returns plain text with a trailing newline and ignored the `X-Forwarded-For` header in our test. Always query over `https://`. If you check often, run your own echo endpoint so you don't strain the public services.

### Why doesn't the IP change on a rotating proxy?

Usually because of connection pooling. A rotating gateway picks the exit when the connection opens. `requests.Session`, an httpx client or a shared `ProxyAgent` reuses the same tunnel, so consecutive requests leave from the same exit. Open a new connection for each check. If the problem persists, check whether a sticky session setting is still on.

### How do I see my IPv6 exit address?

Call `api6.ipify.org` or `ipv6.icanhazip.com` through the proxy. These domains have IPv6 records only, so the request fails if the exit has no IPv6. To see which family is in use, `api64.ipify.org` is the safer choice. curl's `-6` flag affects only the connection to the proxy, not the exit.

### How do I check the exit IP in a browser?

With the browser's proxy setting on, open `https://api.ipify.org` or `https://icanhazip.com`. The address on the page is your exit IP. If you see your own address, the browser is not using the proxy. Reloading the tab does not always bring a new IP. The browser can also reuse an open connection for a while.

### Do I need my own echo endpoint?

Yes, if you check often. Public services may slow requests down or return `429` under heavy traffic. On your own server you set the rate limit and you know whether the service trusts headers. The `echo.mjs` in this post is a few lines long. If you put a reverse proxy in front of it, trust only the value you added yourself in the `X-Forwarded-For` list.
