Using Environment Variable

In a very simple word, you can simply set the following environment variables on your system. The curl command will automatically use these variables as a proxy. You can export those variables in your shell, like: After exporting the environment variables, the curl command will automatically use the above proxy during a remote connection. Once your work is done, you can simply unset these environment variables like:

Without Environment Variable

Instead of setting environment variables, you can simply pass the proxy details to curl command as a command-line parameter.