Is it possible to get the proxy address that my system is currently using in order to populate HTTP_PROXY variable from command line ?
I would like a command so that I could set it in my .bashrc file.
complete solution for me was to update my .bashrc file with this
function http_proxy {
export http_proxy=`networksetup -getwebproxy Wi-Fi | head -3 | tail -2 | cut -f2 -d' ' | sed 'N;s/\n/:/'|grep -v ':0'`
}
alias homen="networksetup -setwebproxy Wi-Fi '' ;http_proxy"
alias ofcn="networksetup -setwebproxy Wi-Fi proxy.examp.com 8080;http_proxy"
http_proxy
