Httpx-ws

Latest version: v0.6.0

Safety actively analyzes 623395 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.6.0

Breaking changes
----------------

* [`AsyncWebSocketSession`](https://frankie567.github.io/httpx-ws/reference/httpx_ws/#httpx_ws.AsyncWebSocketSession) and [`WebSocketSession`](https://frankie567.github.io/httpx-ws/reference/httpx_ws/#httpx_ws.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.

Improvements
------------

* [`AsyncWebSocketSession`](https://frankie567.github.io/httpx-ws/reference/httpx_ws/#httpx_ws.AsyncWebSocketSession) and [`WebSocketSession`](https://frankie567.github.io/httpx-ws/reference/httpx_ws/#httpx_ws.WebSocketSession) now accepts the original HTTPX handshake response in parameter. Thanks WSH032 🎉

0.5.2

Bug fixes
---------

* Set `anyio` dependency lower bound version to `>4`

0.5.1

Bug fixes and improvements
--------------------------

* Always disable automatic keepalive ping when using ASGI transport. Thanks dmontagu and Kludex 🎉
* Bump dependencies:
* `httpcore>=1.0.4` - Solves 7, thanks to tomchristie and MtkN1 🎉

0.5.0

New features
------------

* `asyncio` and [Trio](https://trio.readthedocs.io/) support through [AnyIO](https://anyio.readthedocs.io/)

Breaking changes
----------------

* `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:

py
with WebSocketSession(...) as session:
...

async with AsyncWebSocketSession(...) as session:
...


* `AsyncWebSocketSession.receive_*` methods may now raise `TimeoutError` instead of `asyncio.TimeoutError`:

**Before**

py
try:
event = await ws.receive(timeout=2.)
except asyncio.TimeoutError:
print("No event received.")
except WebSocketDisconnect:
print("Connection closed")


**After**

py
try:
event = await ws.receive(timeout=2.)
except TimeoutError:
print("No event received.")
except WebSocketDisconnect:
print("Connection closed")

0.4.3

Bug fixes & improvements
------------------------

* Fix 57: compatibility with `httpx>=0.25.2`
* Fix 56: `ASGIWebSocketTransport` returns the correct response from server when opening connection, allowing proper support of subprotocols.

0.4.2

Bug fixes
---------

* Fix anyio `start_blocking_portal` import. Thanks maparent 🎉
* Fix 40: handle large message buffering
* Fix 34: handle subprotocols corrrectly in `ASGIWebSocketTransport`

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.