Subject: CVS commit: pkgsrc/www/py-websockets
From: Adam Ciarcinski
Date: 2021-11-23 22:02:13
Message id:

Log Message:
py-websockets: updated to 10.1


New features

Added a tutorial.

Made the second parameter of connection handlers optional. It will be deprecated \ 
in the next major release. The request path is available in the \ 
:attr:`~legacy.protocol.WebSocketCommonProtocol.path` attribute of the first \ 

If you implemented the connection handler of a server as:

async def handler(request, path):
You should replace it by:

async def handler(request):
    path = request.path  # if handler() uses the path argument
Added python -m websockets --version.


Added wheels for Python 3.10, PyPy 3.7, and for more platforms.
Reverted optimization of default compression settings for clients, mainly to \ 
avoid triggering bugs in poorly implemented servers like AWS API Gateway.
Mirrored the entire :class:`~asyncio.Server` API in :class:`~server.WebSocketServer`.
Improved performance for large messages on ARM processors.
Documented how to auto-reload on code changes in development.
Bug fixes

Avoided half-closing TCP connections that are already closed.


Backwards-incompatible changes

websockets 10.0 requires Python ≥ 3.7.

websockets 9.1 is the last version supporting Python 3.6.

The loop parameter is deprecated from all APIs.

This reflects a decision made in Python 3.8. See the release notes of Python \ 
3.10 for details.

The loop parameter is also removed from :class:`~server.WebSocketServer`. This \ 
should be transparent.

:func:`~client.connect` times out after 10 seconds by default.

You can adjust the timeout with the open_timeout parameter. Set it to \ 
:obj:`None` to disable the timeout entirely.

The legacy_recv option is deprecated.

See the release notes of websockets 3.0 for details.

The signature of :exc:`~exceptions.ConnectionClosed` changed.

If you raise :exc:`~exceptions.ConnectionClosed` or a subclass, rather than \ 
catch them when websockets raises them, you must change your code.

A msg parameter was added to :exc:`~exceptions.InvalidURI`.

If you raise :exc:`~exceptions.InvalidURI`, rather than catch it when websockets \ 
raises it, you must change your code.

New features

websockets 10.0 introduces a Sans-I/O API for easier integration in third-party \ 

If you're integrating websockets in a library, rather than just using it, look \ 
at the :doc:`Sans-I/O integration guide <../howto/sansio>`.

Added compatibility with Python 3.10.
Added :func:`~websockets.broadcast` to send a message to many clients.
Added support for reconnecting automatically by using :func:`~client.connect` as \ 
an asynchronous iterator.
Added open_timeout to :func:`~client.connect`.
Documented how to integrate with Django.
Documented how to deploy websockets in production, with several options.
Documented how to authenticate connections.
Documented how to broadcast messages to many connections.

Improved logging. See the :doc:`logging guide <../topics/logging>`.
Optimized default compression settings to reduce memory usage.
Optimized processing of client-to-server messages when the C extension isn't \ 
Supported relative redirects in :func:`~client.connect`.
Handled TCP connection drops during the opening handshake.
Made it easier to customize authentication with \ 
Provided additional information in :exc:`~exceptions.ConnectionClosed` exceptions.
Clarified several exceptions or log messages.
Restructured documentation.
Improved API documentation.
Extended FAQ.
Bug fixes

Avoided a crash when receiving a ping while the connection is closing.