Skip to main content
What's cURL?

Let's learn about cURL and how can it be useful when working with proxies.

Updated over a week ago

What is Curl?
Curl is a free and open-source command-line tool available on Windows, Mac and Linux that helps you transfer data over the internet. It works with protocols like HTTP and HTTPS. Curl is great for testing, checking and fixing network requests and API calls.

What is a Proxy Server?
A proxy server is like a middleman between you (your browser, app, etc.) and the website/service you want to access. It helps transfer data back and forth. Proxy servers can add extra security and features, like changing the location the website/service sees you coming from. When you use a proxy server, all your internet requests go through it first, and then it sends them to the website. The website's response also goes through the proxy server before it reaches you.

Does Curl support proxies?

Yes, Curl supports proxies via the -x or --proxy command line option.

Installing cURL

  1. If you have version 1803 or later of Windows 10, cURL is installed by default. If not, visit the official website https://curl.se for instructions.

  2. On Mac, cURL is installed by default on all versions.

  3. On Linux, most distributions come with cURL installed by default. However, if it's not, you can install it using your distribution's package manager with the syntax sudo [apt/yum] install curl.

Testing your cURL installation

In order to test your cURL installation, we will perform an HTTP request to https://ip-api.com.

Open a console (or Terminal) window in your device and write the following command:

curl ip-api.com

Afterwards, press Enter (or Return). We will now see information about our current IP address according to ip-api's database.

Testing your proxy via cURL

The curl command accepts the use of proxies which can be supplied via the -x or --proxy arguments. They both mean the same thing, and work as follows:

curl -x http://username:[email protected]:5959 ip-api.com

or

curl --proxy http://username:[email protected]:5959 ip-api.com

Let's try using one of our Rotating Residential IPv4 Proxies. Conveniently, we can copy the "Proxy URI" field from our 'user:pass Authorisation' tab of the 'Quick Access' section inside our Subscription page.

Let's copy the string and compose our command in the terminal, and then hit 'Enter'.

curl --proxy http://username-res-ANY:[email protected]:5959 ip-api.com

We can now see ip-api returns a different IP address as it only sees the IP address from our proxy, alongside with different Location and ISP information. Changing settings in the Quick Access, copying the new Proxy URI and trying again will give different results based on the input. Find out more on how to use our Rotating IPv4 Proxies.

Did this answer your question?