What is The cURL (28) Error, Couldn't connect to server?

The cURL (28) indicates a proxy connection error. The full error traceback looks like the following:

curl: (28) Failed to connect to XXXX port XXXX after 21057 ms: Couldn't connect to server

This error arises when the cURL request can't connect to the proxy server, either because the server isn't responding or the proxy details are invalid. To solve the cURL (28) error, double-check your proxy IP and port or use another proxy, as it can be down or unresponsive.

For further details on proxies, including their types and best practices when choosing a proxy, refer to our introduction guide.

Introduction To Proxies in Web Scraping

Discover the different types of proxies, how they compare, and the best practices for web scraping while tackling common proxy challenges.

proxies article banner
Question tagged: cURL, Proxies

Related Posts

Sending HTTP Requests With Curlie: A better cURL

In this guide, we'll explore Curlie, a better cURL version. We'll start by defining what Curlie is and how it compares to cURL. We'll also go over a step-by-step guide on using and configuring Curlie to send HTTP requests.

How to Use cURL For Web Scraping

In this article, we'll go over a step-by-step guide on sending and configuring HTTP requests with cURL. We'll also explore advanced usages of cURL for web scraping, such as scraping dynamic pages and avoiding getting blocked.

Use Curl Impersonate to scrape as Chrome or Firefox

Learn how to prevent TLS fingerprinting by impersonating normal web browser configurations. We'll start by explaining what the Curl Impersonate is, how it works, how to install and use it. Finally, we'll explore using it with Python to avoid web scraping blocking.