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

Provided by Scrapfly

This knowledgebase is provided by Scrapfly — a web scraping API that allows you to scrape any website without getting blocked and implements a dozens of other web scraping conveniences. Check us out 👇