Proxy configuration is currently supported through two connection pool subclasses...
SyncHTTPProxy(...)
SyncSOCKSProxy(...)
We could instead have proxy configuration on the main class...
pool = httpcore.SyncConnectionPool(
ssl_context=ssl_context,
proxy=httpcore.Proxy(url, auth, headers, ssl_context),
...
)
With the switching handled in create_connection.
Benefits...
- Neater API, with fewer types exposed.
- Opens a pathway to handling system proxies within
httpcore rather than at the layer above.
* Let's also have a httpcore.Proxy() class here to encapsulate the configuration.