Error reference HTTP status

Error 522: Connection Timed Out

Error 522 'Connection Timed Out' is Cloudflare telling you it couldn't open a TCP connection to the website's origin server. Your client, your DNS, and your proxy all did their jobs — the failure sits between Cloudflare's edge and the site's own infrastructure. Here's how to confirm that, what you can genuinely do about it, and how to build retries that handle it cleanly.

522 Connection Timed Out

What error 522 means

HTTP 522 'Connection Timed Out' is a Cloudflare-specific status code. It means Cloudflare's edge received your request normally, tried to open a TCP connection to the website's origin server on your behalf, and the origin failed to complete the handshake within Cloudflare's time limit. The response you see is generated by Cloudflare, not by the site itself.

The important diagnostic detail: everything on your side of the request worked. Your DNS resolution, your proxy connection, and your TLS session with Cloudflare's edge all succeeded — otherwise you would have received a local error in your client, not a rendered 522 page. The failure sits on the far side, between Cloudflare and the site's own servers.

Typical root causes are an offline or overloaded origin, a firewall on the origin dropping packets from Cloudflare's IP ranges, DNS records at Cloudflare pointing to a stale origin IP, or connection-table exhaustion when the server is swamped. Heavy traffic bursts — including aggressive crawling — can tip a small origin into that last state.

522 Connection Timed Out

How to fix error 522

You can't repair someone else's origin server, but most 522s are transient and route- or load-dependent, which leaves you real options. Work through these in order of likelihood.

  1. Confirm the response is a Cloudflare-branded error page with an HTTP status of 522 — that proves the failure is between Cloudflare and the origin, not in your client or proxy.
  2. Retry once after 30–60 seconds. Origin overload is the most common cause, and brief spikes often clear quickly.
  3. Add exponential backoff with a retry cap — for example three attempts at 30s, 60s, 120s — and treat 522 as a retryable status in your HTTP client.
  4. Reduce concurrency. Dozens of parallel requests against a small site can exhaust its connection backlog and cause the very 522s you're retrying.
  5. Test the URL from a different network or exit region. If it loads elsewhere, the problem is specific to the path between one Cloudflare data center and the origin.
  6. Check an independent status source — the site's status page or a downtime checker — before burning retries on a site that is fully down.
  7. If the 522 persists for hours from every region, the origin is down or misconfigured. Pause that target and resume later instead of hammering it.
  8. Log 522s separately from local connect timeouts (curl: (28) and friends) so your monitoring doesn't misattribute origin failures to your proxy layer.
522 Connection Timed Out

Where proxies fit into a 522

A proxy cannot cause a 522 — by the time Cloudflare renders that page, your request has already traveled through the proxy and been accepted at the edge. What your proxy setup does control is which Cloudflare data center you land on, how your load is spread across the target, and whether your retry logic can tell origin failures apart from genuine proxy issues.

Cloudflare routes requests by anycast: the data center that serves you is chosen based on your exit IP's network location. Because 522s are sometimes specific to the path between one data center and the origin, changing your exit geography is a legitimate diagnostic step — and occasionally a fix.

Switch exit regions in seconds

Appending a country to the proxy username (for example -country-de) moves your exit to another region, which lands you on a different Cloudflare data center. If the 522 clears from a new region, you've confirmed a route-specific failure.

ProxyOmega supports country targeting on Budget Unlimited across 200+ countries, and country, state, city, and ASN targeting on Platinum ISP-grade residential ports.

Spread load so you don't create 522s

A burst of parallel requests from one runner can push a fragile origin into connection exhaustion. Per-port interval rotation on Budget Unlimited spreads requests across a 1.5M+ residential pool, and unmetered bandwidth removes any incentive to burst.

Pacing per session keeps any single path polite — which keeps small origins answering instead of timing out.

Classify errors correctly

A proxy-side failure shows up as a local error with no HTTP status: a connect timeout, a reset, or a 407 if credentials are wrong. A 522 is a real HTTP response carrying a Cloudflare page.

Keeping the two separate in logs stops you from rotating IPs to fix an origin that's simply down — and from blaming your proxy for a target-side outage.

522 Connection Timed Out

A retry pattern that handles 522 correctly

The snippet below treats 522 (and its sibling 524) as retryable origin-side statuses, backs off between attempts, and routes through a ProxyOmega residential port. Changing the -country- value is all it takes to re-test from a different region — the same pattern drops into Scrapy or Playwright via the guides at /integration/scrapy/ and /integration/playwright/.

import time
import requests

PROXY_USER = "USERNAME-country-us"   # change the country to test another route
PROXY_PASS = "PASSWORD"              # your dashboard API key
PROXY = f"http://{PROXY_USER}:{PROXY_PASS}@residential.proxyomega.com:10000"

proxies = {"http": PROXY, "https": PROXY}
RETRYABLE = {522, 524}

def fetch(url, attempts=4):
    delay = 30
    for _ in range(attempts):
        r = requests.get(url, proxies=proxies, timeout=30)
        if r.status_code not in RETRYABLE:
            return r
        time.sleep(delay)   # 522 is origin-side and usually transient
        delay *= 2
    return r

resp = fetch("https://example.com/page")
print(resp.status_code, len(resp.content))
FAQ

Frequently asked questions

Is error 522 caused by my proxy or VPN?
No. A rendered 522 page proves your request passed through your proxy and reached Cloudflare's edge successfully. The timeout happened afterward, when Cloudflare tried to open a TCP connection to the website's origin server. Proxy-layer failures look different: local connect timeouts, resets, or 407 responses, with no Cloudflare error page attached.
How long should I wait before retrying a 522?
Start at 30–60 seconds and back off exponentially, capping at three or four attempts. Most 522s are brief load spikes that clear within minutes. If the error persists across several hours and from multiple exit regions, the origin is genuinely down or misconfigured — schedule the job to resume later rather than retrying continuously.
Why do I get a 522 on one network but not another?
Cloudflare picks the data center that serves you based on your exit IP's location, and the network path from each data center to the origin differs. A firewall rule, a routing problem, or regional overload can break one path while others work. Switching exit country through a proxy changes the data center — and often the outcome.
Does a 522 mean the site is blocking my scraper?
Usually not. Deliberate blocking normally surfaces as 403, 429, or a challenge page — the site has to be up to block you. A 522 means the origin didn't answer Cloudflare at all. That said, very aggressive crawling can overload a small origin into 522 territory, so throttle concurrency before assuming the site is at fault.

See errors from every angle. Start routing today.

Switch exit countries with one username change — ProxyOmega's network spans 90M+ IPs across 200+ countries for route-level debugging at scale.

ProxyOmega ProxyOmega

90M+ ethically-sourced IPs across 200+ countries and 30,000+ cities. Residential, mobile, ISP and IPv6 proxies for scraping and AI agents.

GDPRCCPA
Product
Premium Unlimited Budget Unlimited Residential / ISP Mobile IPv6 Chrome Extension
Solutions
Web scraping AI agents Price monitoring SERP & SEO Integrations All use cases
Resources
Glossary Error codes Free tools Proxies by platform Locations
Company
About Blog Docs Reseller program Affiliate Contact Sign in
© 2026 ProxyOmega Ltd. All rights reserved.