GHC 2017-06-23

1 comment.

, https://git.io/vQmiN in jarun/googler
`HTTPSConnection` does support proxy authentication, at least basic auth. This is because `HTTPConnection.set_tunnel` has the `headers` options, and HTTP Basic Auth, in the context of proxy authentication, is nothing other than a `Proxy-Authorization` header. See [docs](https://docs.python.org/3/library/http.client.html#http.client.HTTPConnection.set_tunnel).

To give you a concrete example, say my username & password combo is `user:passwd`. `user:passwd` base64-encodes to `dXNlcjpwYXNzd2Q=`. Then I simply replace

```py
self._conn.set_tunnel(host, port=port)
```

with

```py
self._conn.set_tunnel(host, port=port, headers={'Proxy-Authorization': 'Basic dXNlcjpwYXNzd2Q='})
```

in the code and the proxy would let me in.

Could you please try to contribute this feature with a PR? Ideally we would support the same proxy specifications as curl, i.e.,

```
--proxy <[protocol://][user:password@]proxyhost[:port]>
```

where we only support the HTTP and HTTPS protocols.