Troubleshooting 4 min read

Proxy IP Not Changing? Why Rotation Seems Stuck and How to Fix It

Rotation happens per connection, and your client is very good at reusing connections. Here's how to see what's going on and get a fresh IP when you want one.

If your proxy IP is not changing between requests even though you're using rotating proxies, the proxy is almost never the cause. Much more often, your client is reusing one connection for many requests, a session parameter is still in the username, or the page showing your IP is cached. This guide shows how to test rotation cleanly and then fix it in curl, Python, Node and browsers.

First, Test Rotation Without Your Code

curl opens a fresh connection on every invocation, so it's the cleanest test:

for i in 1 2 3 4 5; do
  curl -s -x http://USERNAME:[email protected]:8080 https://api.ipify.org
  echo
done

On NodeProxies, a username with no session parameter gets a new IP per request, so you should see different addresses. If curl shows rotation but your program doesn't, the issue is in how your program reuses connections. If curl shows the same IP every time, check the username.

Cause 1: A Session Parameter in the Username

A username like USERNAME-session-abc123-time-10 is a sticky session: the same session id keeps the same IP until the time runs out. That's the point of sticky sessions, but it's easy to leave one in a config file and forget. Remove the -session-...-time-... part to rotate on every request, or generate a new session id whenever you want a new IP:

import uuid

def proxy_for_new_ip(country="us"):
    sid = uuid.uuid4().hex[:10]
    user = f"USERNAME-country-{country}-session-{sid}-time-10"
    url = f"http://{user}:[email protected]:8080"
    return {"http": url, "https": url}

Also check for the opposite mistake: a session id generated once at startup and reused for every worker. All workers then share one IP.

Cause 2: Keep-Alive Reuses the Same Tunnel

For HTTPS, your client opens a CONNECT tunnel through one exit and then speaks TLS to the website inside it. As long as that tunnel stays open, every request sent through it leaves from the same exit IP. HTTP clients reuse connections aggressively for speed, so requests.Session in Python, keep-alive agents in Node, and every browser will happily send dozens of requests down one tunnel.

In Python, this means a Session to the same host keeps the same IP:

import requests

PROXY = "http://USERNAME:[email protected]:8080"
proxies = {"http": PROXY, "https": PROXY}

# Same IP each time: the session reuses one tunnel
s = requests.Session()
for _ in range(3):
    print("session:", s.get("https://api.ipify.org", proxies=proxies).text)

# New IP each time: ask the server to close the connection after each response
for _ in range(3):
    r = s.get("https://api.ipify.org", proxies=proxies,
              headers={"Connection": "close"})
    print("close:", r.text)

# Also new IP each time: plain requests.get opens a new connection per call
for _ in range(3):
    print("get:", requests.get("https://api.ipify.org", proxies=proxies).text)

In Node.js, don't pass a keepAlive agent if you want per-request rotation, or create a fresh proxy agent per request. Our Node.js, Axios and Puppeteer guide shows agent setup.

Connection reuse isn't bad. It's faster and it's often what you want on one site. Decide deliberately: rotate across tasks, keep one IP within a task. Rotating vs. sticky proxies covers the pattern.

Cause 3: Browsers Hold Connections Open

In Chrome, Firefox, Playwright or Selenium, the browser keeps connections to each site open for a while and reuses them across page loads. Reloading a page often shows the same IP. With an automated browser, start a new browser context for each identity, and use an explicit sticky session id per context so you control when the IP changes, rather than relying on accidental rotation. See headless browser proxies for setup.

Cause 4: The IP Checker Is Cached

Some "what is my IP" pages are cached by a CDN or by your browser. Use an endpoint that returns plain text and isn't cached, such as https://api.ipify.org, or our what is my IP tool in a fresh private window.

Cause 5: The Same IP Repeats by Chance

With country targeting on a small country, a large sample may contain an occasional repeat. Two identical IPs in a row out of a hundred requests is normal. Every request returning the same IP is not.

Rotation Checklist

  1. Test with the curl loop. Rotation there means the proxy is rotating.
  2. Remove any -session-...-time-... from the username, or generate a new id per task.
  3. Don't reuse a keep-alive connection when you want a new IP; send Connection: close or open a new client.
  4. In browsers, use a new context per identity and explicit session ids.
  5. Verify with an uncached IP endpoint.

Rotating IPs with NodeProxies

Rotating residential proxies give a new IP per request by default and sticky IPs when you add a session id. Build usernames with the proxy username builder, then sign up to get credentials.

FAQ

Why does my rotating proxy keep the same IP?

Most often your client reuses one keep-alive connection, or the username still contains a sticky session id. The curl loop above tells you which.

How do I force a new IP on every request?

Use a username without a session parameter and make sure each request opens a new connection, for example with requests.get instead of a shared Session, or with a Connection: close header.

How long does a sticky session keep the same IP?

Until the time in the username runs out, for example 10 minutes with -time-10. A new session id gets a new IP immediately.

NodeProxies

Ready to get started?

90M+ residential, mobile & datacenter proxies. Datacenter from $0.30/GB, residential from $0.42/GB. No contracts.

Create free account