Skip to content

Commit

Permalink
Support HTTP/3
Browse files Browse the repository at this point in the history
  • Loading branch information
karpetrosyan committed Oct 19, 2023
1 parent 7fce352 commit bd31869
Show file tree
Hide file tree
Showing 9 changed files with 1,118 additions and 4 deletions.
4 changes: 4 additions & 0 deletions httpcore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
AsyncConnectionInterface,
AsyncConnectionPool,
AsyncHTTP2Connection,
AsyncHTTP3Connection,
AsyncHTTP11Connection,
AsyncHTTPConnection,
AsyncHTTPProxy,
Expand Down Expand Up @@ -40,6 +41,7 @@
ConnectionInterface,
ConnectionPool,
HTTP2Connection,
HTTP3Connection,
HTTP11Connection,
HTTPConnection,
HTTPProxy,
Expand Down Expand Up @@ -85,6 +87,7 @@ def __init__(self, *args, **kwargs): # type: ignore
"AsyncHTTPProxy",
"AsyncHTTP11Connection",
"AsyncHTTP2Connection",
"AsyncHTTP3Connection",
"AsyncConnectionInterface",
"AsyncSOCKSProxy",
# sync
Expand All @@ -93,6 +96,7 @@ def __init__(self, *args, **kwargs): # type: ignore
"HTTPProxy",
"HTTP11Connection",
"HTTP2Connection",
"HTTP3Connection",
"ConnectionInterface",
"SOCKSProxy",
# network backends, implementations
Expand Down
13 changes: 13 additions & 0 deletions httpcore/_async/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ def __init__(self, *args, **kwargs) -> None: # type: ignore
)


try:
from .http3 import AsyncHTTP3Connection
except ImportError: # pragma: nocover

class AsyncHTTP3Connection: # type: ignore
def __init__(self, *args, **kwargs) -> None: # type: ignore
raise RuntimeError(
"Attempted to use http3 support, but the `aioquic` package is not "
"installed. Use 'pip install httpcore[http3]'."
)


try:
from .socks_proxy import AsyncSOCKSProxy
except ImportError: # pragma: nocover
Expand All @@ -34,6 +46,7 @@ def __init__(self, *args, **kwargs) -> None: # type: ignore
"AsyncHTTPProxy",
"AsyncHTTP11Connection",
"AsyncHTTP2Connection",
"AsyncHTTP3Connection",
"AsyncConnectionInterface",
"AsyncSOCKSProxy",
]
Loading

0 comments on commit bd31869

Please sign in to comment.