This makes SSL connections via proxies work correctly.
Merge pull request #159 from chrchr/proxy_with_ssl

This makes SSL connections via proxies work correctly.