making curl requests through a proxy

CLI Option

syntax
-x, --proxy <[protocol://][user:password@]proxyhost[:port]>
example
curl -x http://localhost:8080/ http://www.google.com/

Setting Environment Variable

HTTP Proxy
export http_proxy=http://your.proxy.server:port/
export HTTP_PROXY=http://your.proxy.server:port/
HTTPS Proxy
export https_proxy=https://your.proxy.server:port/
export HTTPS_PROXY=https://your.proxy.server:port/