Support an HTTPS proxy, including the environment variable.

As per issue 316.