How to install an homebrew package behind a proxy?
To run Homebrew or Curl behind a proxy :

export ALL_PROXY=$http_proxy:port 


or

export ALL_PROXY=proxyIP:port


After this is done, installation worked smoothly.