http proxy support

I have tested the changes with my program that copies Heroku releases and it works both without and with a proxy (Charles on OS/X)

I hope that the code meets your standards