$ export https_proxy='87.248.188.202:8080'
$ export http_proxy='87.248.188.202:8080'
$ curl https://icanhazip.com
87.248.188.202
$ curl http://icanhazip.com
87.248.188.202
$ curl -sS https://getcomposer.org/installer | php
(alternative: just download https://getcomposer.org/composer.phar
, duh)
$ php composer.phar diagnose
In my case, i need to specify protocol and authentication credential in the environment variable.