Skip to content

Commit 8fc5ff3

Browse files
committed
Support HTTP/3
1 parent 59d4cde commit 8fc5ff3

File tree

9 files changed

+1118
-4
lines changed

9 files changed

+1118
-4
lines changed

httpcore/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
AsyncConnectionInterface,
44
AsyncConnectionPool,
55
AsyncHTTP2Connection,
6+
AsyncHTTP3Connection,
67
AsyncHTTP11Connection,
78
AsyncHTTPConnection,
89
AsyncHTTPProxy,
@@ -40,6 +41,7 @@
4041
ConnectionInterface,
4142
ConnectionPool,
4243
HTTP2Connection,
44+
HTTP3Connection,
4345
HTTP11Connection,
4446
HTTPConnection,
4547
HTTPProxy,
@@ -85,6 +87,7 @@ def __init__(self, *args, **kwargs): # type: ignore
8587
"AsyncHTTPProxy",
8688
"AsyncHTTP11Connection",
8789
"AsyncHTTP2Connection",
90+
"AsyncHTTP3Connection",
8891
"AsyncConnectionInterface",
8992
"AsyncSOCKSProxy",
9093
# sync
@@ -93,6 +96,7 @@ def __init__(self, *args, **kwargs): # type: ignore
9396
"HTTPProxy",
9497
"HTTP11Connection",
9598
"HTTP2Connection",
99+
"HTTP3Connection",
96100
"ConnectionInterface",
97101
"SOCKSProxy",
98102
# network backends, implementations

httpcore/_async/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ def __init__(self, *args, **kwargs) -> None: # type: ignore
1616
)
1717

1818

19+
try:
20+
from .http3 import AsyncHTTP3Connection
21+
except ImportError: # pragma: nocover
22+
23+
class AsyncHTTP3Connection: # type: ignore
24+
def __init__(self, *args, **kwargs) -> None: # type: ignore
25+
raise RuntimeError(
26+
"Attempted to use http3 support, but the `aioquic` package is not "
27+
"installed. Use 'pip install httpcore[http3]'."
28+
)
29+
30+
1931
try:
2032
from .socks_proxy import AsyncSOCKSProxy
2133
except ImportError: # pragma: nocover
@@ -34,6 +46,7 @@ def __init__(self, *args, **kwargs) -> None: # type: ignore
3446
"AsyncHTTPProxy",
3547
"AsyncHTTP11Connection",
3648
"AsyncHTTP2Connection",
49+
"AsyncHTTP3Connection",
3750
"AsyncConnectionInterface",
3851
"AsyncSOCKSProxy",
3952
]

0 commit comments

Comments
 (0)