Error reference cURL

How to fix cURL error 7: failed to connect

curl: (7) Failed to connect means DNS succeeded — curl knew exactly which IP and port to dial — but the TCP connection itself was refused or blocked. Something between your machine and that port said no: a wrong port number, a firewall or security group, a service that isn't listening, or a proxy that rejects your source IP. Work outward layer by layer.

cURL Error 7: Failed to Connect

What cURL error 7 means

Error 7 (CURLE_COULDNT_CONNECT) fires after successful name resolution: curl sent a TCP SYN to a specific IP and port and got a refusal (RST), an unreachable error, or nothing usable back. When a proxy is configured, the connection being tested is the one to the proxy — the target site isn't involved yet at this stage.

The verbose output tells you which hop failed: a line like Failed to connect to residential.proxyomega.com port 10000 points at the proxy leg; without a proxy, the same message names the target host. That distinction decides everything that follows, so run with -v before changing anything.

A refusal means the machine is reachable but nothing accepts connections on that port — usually a wrong port number or a stopped service. Silence (which can surface as error 7 or as error 28, a timeout) usually means a firewall dropping packets: corporate egress rules, a cloud security group, or an access control on the proxy side that doesn't recognize your source IP.

cURL Error 7: Failed to Connect

How to fix cURL error 7

Establish which hop refuses you, then test reachability with the simplest possible tool before touching curl again.

  1. Run with -v and read which host and port failed. Everything below assumes you now know whether the proxy or the target is refusing you.
  2. Verify the port number against your provider's documentation or dashboard — dialing a port nothing listens on is the single most common cause, and it fails instantly with connection refused.
  3. Test raw reachability: nc -zv residential.proxyomega.com 10000 (or telnet). If nc connects and curl doesn't, the problem is in your curl options; if nc also fails, it's network-level.
  4. Using IP whitelist authentication? Confirm your current public IP with curl -sS https://api.ipify.org (no proxy) and compare it to the whitelist — home IPs change with ISP leases, and a new server or VPN exit presents a different address entirely.
  5. Check egress firewalls: corporate networks and locked-down cloud security groups often allow ports 80 and 443 but block high ports like 10000. Testing from a phone hotspot settles it in seconds.
  6. Force IPv4 with -4. If the hostname returns both A and AAAA records and your IPv6 route is broken, connects can fail even though the service is up.
  7. Rule out interference: env | grep -i proxy for a second proxy layer, VPNs routing traffic into a dead end, or local security software filtering outbound connections.
  8. If the refusal is intermittent, add --connect-timeout 10 --retry 3 while you investigate; flapping connects usually point to the far end or the path, not your command line.
cURL Error 7: Failed to Connect

Proxy connections and error 7: the three usual suspects

When error 7 names your proxy endpoint, curl is telling you the proxy leg is unreachable from this machine, with these options, right now. That narrows the suspects to three: the port you dialed, the network path between you and the proxy, and — specific to proxies — authentication that operates at the connection level rather than inside HTTP.

IP whitelisting is the classic example of that last one. It's convenient — no credentials in URLs, nothing to encode — but it ties access to your source address, and connections from any other IP are rejected before HTTP even starts, which looks exactly like a dead port. ProxyOmega supports both whitelisted IPs and username/password (your dashboard API key); temporarily switching to credentials is the fastest way to confirm or rule out a whitelist mismatch.

Wrong port, or hunting for a port that doesn't exist

A frequent variant: pointing a SOCKS client at a guessed SOCKS port that was never in the documentation. Every ProxyOmega port serves HTTP, HTTPS, and SOCKS5 on the same port — 10000 in these examples — so if SOCKS connects fail on a port you guessed, aim your SOCKS client at the same port your HTTP config already uses.

Whitelist drift: your IP changed, the proxy didn't

IP-whitelisted access breaks silently when your public IP changes: a new DHCP lease at home, a redeployed cloud instance, a VPN toggled on. The proxy refuses the TCP connection, curl reports error 7, and nothing in the message mentions authentication. Keep the whitelist current in the dashboard, or use credential auth on machines whose IPs change.

Egress filtering between you and the proxy

Corporate firewalls, ISP-level filtering, and cloud security groups commonly permit web ports and drop everything else. If nc reaches the proxy from a phone hotspot but not from your office or server, the block is local egress policy: request an exception for the proxy endpoint and port, or run the scraper from a network you control.

cURL Error 7: Failed to Connect

Prove the connection layer by layer

Each command isolates one layer: raw TCP reachability, your current public IP for whitelist verification, then the full proxied request over IPv4 with a tight connect timeout so failures are fast and unambiguous.

# 1. Raw TCP: can this machine reach the proxy port at all?
nc -zv residential.proxyomega.com 10000

# 2. Whitelist users: what IP do you present right now?
#    It must match an entry in your dashboard whitelist.
curl -sS https://api.ipify.org

# 3. Full request, IPv4 forced, fast failure on connect problems
curl -v -4 --connect-timeout 10 \
     -x "http://USERNAME-country-us:[email protected]:10000" \
     https://api.ipify.org
FAQ

Frequently asked questions

Is cURL error 7 the same as a timeout?
No. Error 7 usually means an active refusal or an unreachable network, and the failure is near-immediate. Error 28 is curl giving up after waiting. In practice a firewall that silently drops packets can surface as either, so read the timing: an instant error 7 suggests a wrong port or refusal, while a slow failure suggests filtering or routing.
Why does curl error 7 name my proxy instead of the website?
Because the proxy is the first — and at connect time, the only — thing curl talks to. The target site enters the picture only after the proxy connection succeeds. So error 7 mentioning your proxy host means the proxy leg failed: check the port, your IP whitelist, and firewalls between you and the proxy endpoint before suspecting the site.
My proxy worked yesterday and now every connection is refused. What changed?
Usually something on your side: a changed public IP breaking whitelist authentication (new ISP lease, VPN, redeployed server) or an updated network policy blocking the port. Verify your current IP with curl -sS https://api.ipify.org, compare it against your dashboard whitelist, and test raw reachability with nc from the exact machine that fails.
Which port should I use for SOCKS5 with ProxyOmega?
The same one you use for HTTP. ProxyOmega doesn't run a separate SOCKS5 port — every port, including the 10000 used in these examples, accepts HTTP, HTTPS, and SOCKS5 connections. Error 7 on a guessed SOCKS port simply means nothing listens there; point your SOCKS client at the documented port and the connection goes through the normal path.

Connect once, scale from there Start routing today.

HTTP, HTTPS, and SOCKS5 on every port, with credential or IP whitelist authentication.

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.