Recently I had a requirement to connect to Git including using Composer via an authenticated HTTP proxy server, I thought I’d share my solution with you all.
The machine I was using was a Windows 7 Professional machine (not my OS of choice!), connecting to a corporate proxy server using my ActiveDirectory credentials. After several hours of hunting around I found my own little quick solution, to do this I used the following command:-
C:\wamp\htdocs\myproject\> SET HTTP_PROXY=http://username:firstname.lastname@example.org:8080 && php composer.phar install
Obviously, you should use your own ‘username’, ‘password’, hostname and port in the above example but this should then make everything work as normal!
The above solution requires however that you have both the environment PATH variables set for both PHP and GIT, this should then work without any issues!
I hope this little post helps at-least a few people 🙂