Sessions & rotation · glossary

Keep-alive and rotation

HTTP keep-alive lets a client send several requests over one TCP connection. Through a rotating proxy, the exit is chosen when the connection is opened, so every request reused on that connection leaves from the same IP. Clients that pool connections therefore see fewer IP changes than they expect; forcing a new connection per request restores per-request rotation.

2 min read Also called connection reuse, persistent connections Updated

Symptoms#

  • An IP-echo call returns the same address several times in a row although no session id is set.
  • A target that rate-limits per IP blocks a crawler that "rotates" but reuses a pool of ten connections.

Fixes by client#

ClientHow to get a new connection per request
cURLeach invocation is a new connection already
Python requestsrequests.get(...) without a Session, or headers={"Connection": "close"}
Node.js fetch / undicinew ProxyAgent per request, or pipelining: 1 with keepAliveTimeout: 0
Go net/httpTransport.DisableKeepAlives = true
Browsersnot controllable; use a sticky session instead and rotate by changing -sid-

The other way round#

When you *want* one exit for several requests, keep-alive is your friend on the same connection, but do not rely on it: use a sticky session so the guarantee survives connection resets.

How it works at ProxShift#

ProxShift gateways select the exit per new connection and keep it for the life of that connection (idle connections are closed after 60 seconds). -sid- makes the choice explicit and connection-independent.

Ready when you are

See it on a real request.

Create an account, top up $20 and run the quickstart against your own target. Traffic you buy never expires.