If you are using a proxy correctly, the page will return an IP address that is different from your machine’s, that is, the proxy’s IP address. This particular website is especially useful for testing out proxies as the output of this page is the origin IP address. If you recall, we looked at using curl without proxy like this: curl The next section will cover the first curl proxy scenario, which happens to be the most common one – HTTP and HTTPS proxy with curl. This tutorial will have examples for the scenario when a username and password has to be specified. You can look at all the available options by running curl –help. Similarly, –proxy-digest can be used for digest authentication. If you are on a network that uses NTLM authentication, you can use the switch –proxy-ntlm while running curl. We will look into multiple examples covering various protocols. In this tutorial, we are going to assume that the proxy server is 127.0.0.1, the port is 1234, the user name is user, and the password is pwd.
If you are running an older version of Windows, or if you want to install an alternate version, you can download curl from the official download page. For example, on Ubuntu, open Terminal and run this command: sudo apt install curl If your Linux distribution is not provided with it, you can install it by running the install command.
Now it is provided with Windows 10 as well. InstallationĬURL is provided with many Linux distributions and with MacOS. We recommend reading it if you want to learn how it became such a universal asset. The question “ what is cURL?” is also answered in one of our previous articles. This will print the document information. This will get the HTML of the page and print it on the console. Open your terminal or command prompt and type in this command and press Enter: curl Let’s look at the simplest example of using curl.
This is a fairly technical tutorial and expects readers to have a basic understanding of what a proxy is. All you need to know is the server details and credentials. Therefore this tutorial should work with all proxy servers. We did not target any specific proxy service. It covers all the aspects, beginning from installation to explaining various options to set the proxy.
This step-by-step guide will explain how to use cURL or simply, curl, with proxy servers.