Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add urllib3proxy transport to init #979

Merged
merged 3 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions docs/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ For a comprehensive guide to HTTP/2 you may want to check out "[HTTP2 Explained]

## Enabling HTTP/2

The HTTPX client provides HTTP/2 support, **which is currently only available with the async client**.

HTTP/2 support is not enabled by default, because HTTP/1.1 is a mature,
battle-hardened transport layer, and our HTTP/1.1 may be considered the more robust
option at this point in time. It is possible that a future version of `httpx` may
enable HTTP/2 support by default.
When using the `httpx` client, HTTP/2 support is not enabled by default, because
HTTP/1.1 is a mature, battle-hardened transport layer, and our HTTP/1.1
implementation may be considered the more robust option at this point in time.
It is possible that a future version of `httpx` may enable HTTP/2 support by default.

If you're issuing highly concurrent requests you might want to consider
trying out our HTTP/2 support. You can do so by instantiating a client with
Expand All @@ -43,6 +41,10 @@ async with httpx.AsyncClient(http2=True) as client:
...
```

HTTP/2 support is available on both `Client`, and `AsyncClient`, although it's
typically more useful in async contexts if you're issuing lots of concurrent
requests.

## Inspecting the HTTP version

Enabling HTTP/2 support on the client does not *necessarily* mean that your
Expand Down
3 changes: 2 additions & 1 deletion httpx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from ._models import URL, Cookies, Headers, QueryParams, Request, Response
from ._status_codes import StatusCode, codes
from ._transports.asgi import ASGIDispatch, ASGITransport
from ._transports.urllib3 import URLLib3Transport
from ._transports.urllib3 import URLLib3ProxyTransport, URLLib3Transport
from ._transports.wsgi import WSGIDispatch, WSGITransport

__all__ = [
Expand Down Expand Up @@ -74,6 +74,7 @@
"WriteTimeout",
"URL",
"URLLib3Transport",
"URLLib3ProxyTransport",
"StatusCode",
"Cookies",
"Headers",
Expand Down