add proxy support

Hi gents, we here at Square would like to use your product, but you don't currently support HTTP proxying for the agent.

I've taken a stab at implementing it - it seems that this stuff is untested though, so my confidence that I've done it right is low. Please take a look and let me know if anything else is needed.

Thanks!