How to use curl command with proxy username/password on Linux/ Unix

To use the curl command with a proxy username and password on Linux/Unix, you can use the following syntax:

curl --proxy [proxy-username:proxy-password@]proxy-server-URL [URL]

For example, to make a request to https://www.example.com using a proxy server proxy.example.com with a username of user and password of pass, you would run the following command:

curl --proxy user:pass@proxy.example.com https://www.example.com

Note that the proxy username and password are included in the --proxy option, before the proxy server URL, separated by a colon (:). The proxy server URL should include the http:// or https:// scheme, depending on the type of proxy server you are using.

Leave a Comment