Fix http/https scheme mismatch when using an http(s) proxy

Reuse a well-tested library from another project. Ripe for a gem.