The curl is a command-line tool that is used to download and upload files from the command line without any GUI. Even the curl is a cross-platform tool it is mainly designed and used in Linux distributions like Ubuntu, Mint, Debian, Kali, CentOS. Proxy is an intermediate system in a network that is used to access another part of the network or the internet. The curl command can be also used with proxy but we should provide proxy-related configuration with parameters. In this tutorial, we will learn how to use the curl command for a different type and configuration proxy systems.
Use curl with HTTP Proxy
We will start with a basic curl proxy usage example. The proxy IP address and the proxy port number are provided with the -x or –proxy parameter. In the following example, we will use the proxy with IP address 192.168.100.150 and port number 8080.
$ curl -x 192.168.100.150:8080 http://linuxtect.com
If the DNS is configured to solve the proxy server name into the IP address we may provide the proxy server hostname or domain name like below.
$ curl -x proxy.test.com:8080 http://linuxtect.com
Debug curl Proxy Communication
Proxy usage with the curl command can be problematic. In order to solve the problems, we should get detailed information about the problem. the detailed information can get with a verbose output or debugging the connection with the curl command -v parameter like below.
$ curl -v -x 192.168.100.150:8080 https://linuxtect.com
Use curl with HTTP Proxy and HTTPS URL
HTTPS is the secure and encrypted version of the HTTP protocol. The proxy can be used with the HTTPS protocol where the target URL will be an HTTPS URL. Actually there no change in usage of the curl command and proxy setting where only the target URL will be HTTPS like below.
If the IP needs to be an e-commerce platform or social media, consider selecting roxlabs dedicated computer room IP. Fast IP, easy to set, unlimited traffic.
More on:roxlabs