NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1120 most downloaded on PyPI
WebSockets support for HTTPX
Last release 6 months ago
28 Mar 2026
Release timing varies
gaps range from 1 weeks to 6 months
Nearly every release is documented
notes for 28 of 28 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
28 releases · first in 2022
One column per quarter.
Async exceptions are now wrapped in ExceptionGroup . Due to the switch to anyio.AsyncContextManagerMixin for cancellation safety, exceptions that prop
Bump version 0.8.2 → 0.9.0
Async exceptions are now wrapped in ExceptionGroup. Due to the switch to anyio.AsyncContextManagerMixin for cancellation safety, exceptions that propagate out of the async with block are now wrapped in an ExceptionGroup.
Before:
try:
async with aconnect_ws("http://localhost:8000/ws") as ws:
data = await ws.receive_text()
except WebSocketDisconnect:
print("Connection closed")After:
try:
async with aconnect_ws("http://localhost:8000/ws") as ws:
data = await ws.receive_text()
except* WebSocketDisconnect:
print("Connection closed")Note
Exceptions caught inside the async with block are still plain exceptions and don't require except*.
ASGIWebSocketTransport: increase the initial receive timeout to 1 second and make it configurable via initial_receive_timeout parameter. Fix #123
Bump version 0.8.1 → 0.8.2
initial_receive_timeout parameter. Fix #123ASGI transport: fix cancel scope corruption and allow multiple clients on the same transport ( #116 ). Thanks @davidbrochart 🎉
Bump version 0.8.0 → 0.8.1
New class-based API to open clients. [ Documentation ] Thanks @MtkN1 🎉
Bump version 0.7.2 → 0.8.0
Fix #25 : handle broken/disconnected streams more gracefully. Thanks to @runsisi for research and original fix 🎉
Fix ASGIWebSocketAsyncNetworkStream implementation to avoid async tasks issues. Thanks @graingert 🎉
Bump version 0.7.0 → 0.7.1
ASGIWebSocketAsyncNetworkStream implementation to avoid async tasks issues. Thanks @graingert 🎉Allow to pass a custom session_class on connect_ws / aconnect_ws functions. Thanks @GreyElaina 🎉
Bump version 0.6.2 → 0.7.0
session_class on connect_ws/aconnect_ws functions. Thanks @GreyElaina 🎉Improve efficiency of WebSocketSession by reusing a single thread pool when waiting for messages. Thank you @davidbrochart 🎉
Bump version 0.6.1 → 0.6.2
WebSocketSession by reusing a single thread pool when waiting for messages. Thank you @davidbrochart 🎉Fix ( #73 ) anyio misusages. Thanks @agronholm 🎉
Bump version 0.6.0 → 0.6.1
AsyncWebSocketSession and WebSocketSession no longer accept the subprotocol parameter. It's automatically set from the response headers (see below).
Bump version 0.5.2 → 0.6.0
AsyncWebSocketSession and WebSocketSession no longer accept the subprotocol parameter. It's automatically set from the response headers (see below).Note
If you only use the connect_ws and aconnect_ws functions, you don't need to change anything.
AsyncWebSocketSession and WebSocketSession now accepts the original HTTPX handshake response in parameter. Thanks @WSH032 🎉Set anyio dependency lower bound version to >4
Bump version 0.5.1 → 0.5.2
anyio dependency lower bound version to >4Always disable automatic keepalive ping when using ASGI transport. Thanks @dmontagu and @Kludex 🎉
Bump version 0.5.0 → 0.5.1
httpcore>=1.0.4 - Solves #7, thanks to @tomchristie and @MtkN1 🎉asyncio and Trio support through AnyIO
Bump version 0.4.3 → 0.5.0
WebSocketSession and AsyncWebSocketSession are now context managers. If you were using them directly instead of relying on connect_ws and aconnect_ws, you'll have to adapt your code accordingly:with WebSocketSession(...) as session:
...
async with AsyncWebSocketSession(...) as session:
...
AsyncWebSocketSession.receive_* methods may now raise TimeoutError instead of asyncio.TimeoutError:Before
try:
event = await ws.receive(timeout=2.)
except asyncio.TimeoutError:
print("No event received.")
except WebSocketDisconnect:
print("Connection closed")
After
try:
event = await ws.receive(timeout=2.)
except TimeoutError:
print("No event received.")
except WebSocketDisconnect:
print("Connection closed")
Fix #57: compatibility with httpx>=0.25.2
Bump version 0.4.2 → 0.4.3
httpx>=0.25.2ASGIWebSocketTransport returns the correct response from server when opening connection, allowing proper support of subprotocols.Fix anyio start_blocking_portal import. Thanks @maparent 🎉
Bump version 0.4.1 → 0.4.2
start_blocking_portal import. Thanks @maparent 🎉ASGIWebSocketTransportFix import issue with httpcore>=0.17.3. Thanks @saforem2 🚀
Bump version 0.4.0 → 0.4.1
httpcore>=0.17.3. Thanks @saforem2 🚀Bump version 0.3.1 → 0.4.0 Breaking changes ---------------- * Drop Python 3.7 support
Bump version 0.3.1 → 0.4.0
Fix #30: ASGI transport now correctly handles server errors and closes the WebSocket instead of hanging. Thanks @ysmu 🎉
Bump version 0.3.0 → 0.3.1
Add support for subprotocols [Doccumentation]
Bump version 0.2.6 → 0.3.0
Fix case where we try to schedule tasks in new threadpool during client close
Bump version 0.2.5 → 0.2.6
Fix #19: when both todo task and wait task are done in _wait_until_closed, make sure to always return the todo task result
Bump version 0.2.4 → 0.2.5
_wait_until_closed, make sure to always return the todo task resultFix #15: make sure default HTTPX client is closed.
Bump version 0.2.3 → 0.2.4
When closing, stop background threads early when they're stuck in a waiting operation
Bump version 0.2.2 → 0.2.3
Automatic keepalive ping mechanism
Bump version 0.2.1 → 0.2.2
Handle immediate close from the server in ASGI transport
Bump version 0.2.0 → 0.2.1
Documentation is live ➡️ https://frankie567.github.io/httpx-ws/
Bump version 0.1.1 → 0.2.0
Add a .ping method. Thanks @kousikmitra 🎉
Bump version 0.1.0 → 0.1.1
.ping method. Thanks @kousikmitra 🎉httpx and httpcore dependencies
httpx>=0.23.1httpcore>=0.16.1> ⚠️ This is a very young project. Expect bugs 🐛
Bump version 0.0.0 → 0.1.0
⚠️ This is a very young project. Expect bugs 🐛
connect_ws helper to talk to WebSockets synchronously.aconnect_ws helper to talk to WebSockets asynchronously.ASGIWebSocketTransport to test WebSockets in ASGI apps directly.Your coding agent can read these notes before it upgrades. Set up the MCP server →