How do I set up curl to permanently use a proxy?

Ben picture Ben · Sep 26, 2011 · Viewed 164.2k times · Source

How can I set up "curl" to permanently use a proxy server in the terminal?

Answer

Sandro Munda picture Sandro Munda · Sep 26, 2011

You can make a alias in your ~/.bashrc file :

alias curl="curl -x <proxy_host>:<proxy_port>"

Another solution is to use (maybe the better solution) the ~/.curlrc file (create it if it does not exist) :

proxy = <proxy_host>:<proxy_port>