How do I set a proxy for the cURL command?

cURL (Client URL) is a free, open-source command-line tool.

If you want to request a URL via cURL using a HTTP/SOCKS proxy, follow this guide to make it happen.

Run the command in macOS and Linux.

SOCKS Proxy:

curl -x "socks5://address:port" "https://ipinfo.io"

HTTP Proxy:

curl -x "http://address:port" "https://ipinfo.io"

If you don't have a proxy, get a free one now.

By the way.

Check the cURL manual with this command:

curl --help