Initial Commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,24 @@
|
||||
Copyright (c) Aymeric Augustin and contributors
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,176 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: websockets
|
||||
Version: 11.0.3
|
||||
Summary: An implementation of the WebSocket Protocol (RFC 6455 & 7692)
|
||||
Author-email: Aymeric Augustin <aymeric.augustin@m4x.org>
|
||||
License: BSD-3-Clause
|
||||
Project-URL: homepage, https://github.com/aaugustin/websockets
|
||||
Project-URL: changelog, https://websockets.readthedocs.io/en/stable/project/changelog.html
|
||||
Project-URL: documentation, https://websockets.readthedocs.io/
|
||||
Project-URL: funding, https://tidelift.com/subscription/pkg/pypi-websockets?utm_source=pypi-websockets&utm_medium=referral&utm_campaign=readme
|
||||
Project-URL: tracker, https://github.com/aaugustin/websockets/issues
|
||||
Keywords: WebSocket
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Environment :: Web Environment
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: BSD License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.7
|
||||
Classifier: Programming Language :: Python :: 3.8
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
Requires-Python: >=3.7
|
||||
License-File: LICENSE
|
||||
|
||||
.. image:: logo/horizontal.svg
|
||||
:width: 480px
|
||||
:alt: websockets
|
||||
|
||||
|licence| |version| |pyversions| |tests| |docs| |openssf|
|
||||
|
||||
.. |licence| image:: https://img.shields.io/pypi/l/websockets.svg
|
||||
:target: https://pypi.python.org/pypi/websockets
|
||||
|
||||
.. |version| image:: https://img.shields.io/pypi/v/websockets.svg
|
||||
:target: https://pypi.python.org/pypi/websockets
|
||||
|
||||
.. |pyversions| image:: https://img.shields.io/pypi/pyversions/websockets.svg
|
||||
:target: https://pypi.python.org/pypi/websockets
|
||||
|
||||
.. |tests| image:: https://img.shields.io/github/checks-status/aaugustin/websockets/main?label=tests
|
||||
:target: https://github.com/aaugustin/websockets/actions/workflows/tests.yml
|
||||
|
||||
.. |docs| image:: https://img.shields.io/readthedocs/websockets.svg
|
||||
:target: https://websockets.readthedocs.io/
|
||||
|
||||
.. |openssf| image:: https://bestpractices.coreinfrastructure.org/projects/6475/badge
|
||||
:target: https://bestpractices.coreinfrastructure.org/projects/6475
|
||||
|
||||
What is ``websockets``?
|
||||
-----------------------
|
||||
|
||||
websockets is a library for building WebSocket_ servers and clients in Python
|
||||
with a focus on correctness, simplicity, robustness, and performance.
|
||||
|
||||
.. _WebSocket: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
|
||||
|
||||
Built on top of ``asyncio``, Python's standard asynchronous I/O framework, the
|
||||
default implementation provides an elegant coroutine-based API.
|
||||
|
||||
An implementation on top of ``threading`` and a Sans-I/O implementation are also
|
||||
available.
|
||||
|
||||
`Documentation is available on Read the Docs. <https://websockets.readthedocs.io/>`_
|
||||
|
||||
.. copy-pasted because GitHub doesn't support the include directive
|
||||
|
||||
Here's an echo server with the ``asyncio`` API:
|
||||
|
||||
.. code:: python
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
import asyncio
|
||||
from websockets.server import serve
|
||||
|
||||
async def echo(websocket):
|
||||
async for message in websocket:
|
||||
await websocket.send(message)
|
||||
|
||||
async def main():
|
||||
async with serve(echo, "localhost", 8765):
|
||||
await asyncio.Future() # run forever
|
||||
|
||||
asyncio.run(main())
|
||||
|
||||
Here's how a client sends and receives messages with the ``threading`` API:
|
||||
|
||||
.. code:: python
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
import asyncio
|
||||
from websockets.sync.client import connect
|
||||
|
||||
def hello():
|
||||
with connect("ws://localhost:8765") as websocket:
|
||||
websocket.send("Hello world!")
|
||||
message = websocket.recv()
|
||||
print(f"Received: {message}")
|
||||
|
||||
hello()
|
||||
|
||||
|
||||
Does that look good?
|
||||
|
||||
`Get started with the tutorial! <https://websockets.readthedocs.io/en/stable/intro/index.html>`_
|
||||
|
||||
Why should I use ``websockets``?
|
||||
--------------------------------
|
||||
|
||||
The development of ``websockets`` is shaped by four principles:
|
||||
|
||||
1. **Correctness**: ``websockets`` is heavily tested for compliance with
|
||||
:rfc:`6455`. Continuous integration fails under 100% branch coverage.
|
||||
|
||||
2. **Simplicity**: all you need to understand is ``msg = await ws.recv()`` and
|
||||
``await ws.send(msg)``. ``websockets`` takes care of managing connections
|
||||
so you can focus on your application.
|
||||
|
||||
3. **Robustness**: ``websockets`` is built for production. For example, it was
|
||||
the only library to `handle backpressure correctly`_ before the issue
|
||||
became widely known in the Python community.
|
||||
|
||||
4. **Performance**: memory usage is optimized and configurable. A C extension
|
||||
accelerates expensive operations. It's pre-compiled for Linux, macOS and
|
||||
Windows and packaged in the wheel format for each system and Python version.
|
||||
|
||||
Documentation is a first class concern in the project. Head over to `Read the
|
||||
Docs`_ and see for yourself.
|
||||
|
||||
.. _Read the Docs: https://websockets.readthedocs.io/
|
||||
.. _handle backpressure correctly: https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#websocket-servers
|
||||
|
||||
Why shouldn't I use ``websockets``?
|
||||
-----------------------------------
|
||||
|
||||
* If you prefer callbacks over coroutines: ``websockets`` was created to
|
||||
provide the best coroutine-based API to manage WebSocket connections in
|
||||
Python. Pick another library for a callback-based API.
|
||||
|
||||
* If you're looking for a mixed HTTP / WebSocket library: ``websockets`` aims
|
||||
at being an excellent implementation of :rfc:`6455`: The WebSocket Protocol
|
||||
and :rfc:`7692`: Compression Extensions for WebSocket. Its support for HTTP
|
||||
is minimal — just enough for an HTTP health check.
|
||||
|
||||
If you want to do both in the same server, look at HTTP frameworks that
|
||||
build on top of ``websockets`` to support WebSocket connections, like
|
||||
Sanic_.
|
||||
|
||||
.. _Sanic: https://sanicframework.org/en/
|
||||
|
||||
What else?
|
||||
----------
|
||||
|
||||
Bug reports, patches and suggestions are welcome!
|
||||
|
||||
To report a security vulnerability, please use the `Tidelift security
|
||||
contact`_. Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
.. _Tidelift security contact: https://tidelift.com/security
|
||||
|
||||
For anything else, please open an issue_ or send a `pull request`_.
|
||||
|
||||
.. _issue: https://github.com/aaugustin/websockets/issues/new
|
||||
.. _pull request: https://github.com/aaugustin/websockets/compare/
|
||||
|
||||
Participants must uphold the `Contributor Covenant code of conduct`_.
|
||||
|
||||
.. _Contributor Covenant code of conduct: https://github.com/aaugustin/websockets/blob/main/CODE_OF_CONDUCT.md
|
||||
|
||||
``websockets`` is released under the `BSD license`_.
|
||||
|
||||
.. _BSD license: https://github.com/aaugustin/websockets/blob/main/LICENSE
|
||||
@@ -0,0 +1,88 @@
|
||||
websockets-11.0.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
websockets-11.0.3.dist-info/LICENSE,sha256=D0RRSZisognTSC0QIEqK3yqkKW_xV6NqXAki8igGMtM,1538
|
||||
websockets-11.0.3.dist-info/METADATA,sha256=edSUgF5gqtTk5NUj2OGoTcYHQ6akKjvh1l4Y5ckZ7Xw,6795
|
||||
websockets-11.0.3.dist-info/RECORD,,
|
||||
websockets-11.0.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
websockets-11.0.3.dist-info/WHEEL,sha256=eep6QWEFiQfg2wcclssb_WY-D33AnLYLnEKGA9Rn-VU,100
|
||||
websockets-11.0.3.dist-info/top_level.txt,sha256=CMpdKklxKsvZgCgyltxUWOHibZXZ1uYIVpca9xsQ8Hk,11
|
||||
websockets/__init__.py,sha256=3xrKLebGbcbf1cx0bgD5NRXsdE0u1DfysCpNvgBKaGM,3540
|
||||
websockets/__main__.py,sha256=BMtbQ-dwHfmXmz2STx4nAcdliEKuj2wQXyxe23Vp1S0,4903
|
||||
websockets/__pycache__/__init__.cpython-39.pyc,,
|
||||
websockets/__pycache__/__main__.cpython-39.pyc,,
|
||||
websockets/__pycache__/auth.cpython-39.pyc,,
|
||||
websockets/__pycache__/client.cpython-39.pyc,,
|
||||
websockets/__pycache__/connection.cpython-39.pyc,,
|
||||
websockets/__pycache__/datastructures.cpython-39.pyc,,
|
||||
websockets/__pycache__/exceptions.cpython-39.pyc,,
|
||||
websockets/__pycache__/frames.cpython-39.pyc,,
|
||||
websockets/__pycache__/headers.cpython-39.pyc,,
|
||||
websockets/__pycache__/http.cpython-39.pyc,,
|
||||
websockets/__pycache__/http11.cpython-39.pyc,,
|
||||
websockets/__pycache__/imports.cpython-39.pyc,,
|
||||
websockets/__pycache__/protocol.cpython-39.pyc,,
|
||||
websockets/__pycache__/server.cpython-39.pyc,,
|
||||
websockets/__pycache__/streams.cpython-39.pyc,,
|
||||
websockets/__pycache__/typing.cpython-39.pyc,,
|
||||
websockets/__pycache__/uri.cpython-39.pyc,,
|
||||
websockets/__pycache__/utils.cpython-39.pyc,,
|
||||
websockets/__pycache__/version.cpython-39.pyc,,
|
||||
websockets/auth.py,sha256=8OBgaeuLFDKFBD537TcgFX5tnDL5gUb3LzVD5uIXvVE,143
|
||||
websockets/client.py,sha256=GrI-pWcY5FFGzXtx2TzkvOGMh5iSWaBFpnxTl4zoeXg,12776
|
||||
websockets/connection.py,sha256=dnjnwNSlmNt86T_QKEU6kXhfGA_nHUPgoSn2_iS67tc,346
|
||||
websockets/datastructures.py,sha256=b-J8Hq-Ori5zXkrdFpV6iXh2kGFrf8m4PHKp_49zmXc,5938
|
||||
websockets/exceptions.py,sha256=lWyA8YMjraX1Vy_g9yeWhO7HIN3XbhEbjGRhyK3mJ34,10546
|
||||
websockets/extensions/__init__.py,sha256=HdQaQhOVkCR5RJVRKXG5Xmb6cMpAhLaKgRikYRzO64E,102
|
||||
websockets/extensions/__pycache__/__init__.cpython-39.pyc,,
|
||||
websockets/extensions/__pycache__/base.cpython-39.pyc,,
|
||||
websockets/extensions/__pycache__/permessage_deflate.cpython-39.pyc,,
|
||||
websockets/extensions/base.py,sha256=Udkz03dw1Jb85u0JAD7tWflarEX_yLqumgjY9DFXvaw,3404
|
||||
websockets/extensions/permessage_deflate.py,sha256=BBQSAfHHtVBoOlfyT9kc-sD6AnBay1cr5xeMquK2fuo,25442
|
||||
websockets/frames.py,sha256=LVCOKPpS3EV7Cs6EL0i8sRq9ZoZ1zjUAQbzbmBwaE1Q,12986
|
||||
websockets/headers.py,sha256=ZSdzxVAcJ_O4fEg-PK3v7uuMWoOOR936TOdmt2ceg4U,16707
|
||||
websockets/http.py,sha256=yGB2GWFxQk52lRmzLWC5ks2U6Eej39n6rIYF-nff7jw,674
|
||||
websockets/http11.py,sha256=GDvgVqCxLsX5RXF6v-2OZvsluFUy0J0PsqT_kFuNPXw,12929
|
||||
websockets/imports.py,sha256=9BnKfdMY-4RW_uRv_DkOhDs1i6ZhrWIp245QWZagajc,2889
|
||||
websockets/legacy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
websockets/legacy/__pycache__/__init__.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/async_timeout.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/auth.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/client.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/compatibility.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/framing.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/handshake.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/http.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/protocol.cpython-39.pyc,,
|
||||
websockets/legacy/__pycache__/server.cpython-39.pyc,,
|
||||
websockets/legacy/async_timeout.py,sha256=udgTU_qsiWiwPp8b-NSyqvKtksunihXlMxOX91ISKkE,8805
|
||||
websockets/legacy/auth.py,sha256=z7LHgWN2rd2ugDNCt2Ie17ocHT-t8a8bWmm72fFqUow,6471
|
||||
websockets/legacy/client.py,sha256=sNx7S3z6Cg_FXwGXS54Bc4zn26OlbLp7kfjIX9UfCes,27268
|
||||
websockets/legacy/compatibility.py,sha256=l85rEQsn-fchqCGo0eaAlXtRp-Bz7niGTgGLsu9cniU,791
|
||||
websockets/legacy/framing.py,sha256=4AljNO-aVi0pDIt-7mKp_srw5w-HfrTarBgnJHo5a5I,5174
|
||||
websockets/legacy/handshake.py,sha256=Lk_xqIE1kaU9MHip-hmAXcaWc-pCYynG_JtSukQlImI,5644
|
||||
websockets/legacy/http.py,sha256=ZdG1e9R0MjO-_9FAyRCPZLJMH4Zqb5U4dSO9RL4QG2A,7139
|
||||
websockets/legacy/protocol.py,sha256=pRbWoXLSOLCVvJf5QwAjxsohOqorbB3rIBeKj_gnACU,64981
|
||||
websockets/legacy/server.py,sha256=MAdkHMk6VDmxrDrfcyFQHUIw58s5jdwiLulFq7_TQvA,46428
|
||||
websockets/protocol.py,sha256=6v5KbqQpc8xGteFIUE4EK-6mv2vJVAitf61_BflmKy0,24529
|
||||
websockets/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
websockets/server.py,sha256=EWQ8MzOV8zcM5ZR_a0Hd4cO94kYBzLrDOC_00rcR-n8,21432
|
||||
websockets/speedups.c,sha256=Ihn5ANJ_X-CkK83BSige-5yXWP5_2Ob90BAzx_7vJpo,6057
|
||||
websockets/speedups.cp39-win_amd64.pyd,sha256=r6Gka6traR9JHoc3Y7KKWKJOUB1fcOSAfw7Xmao5yVY,11776
|
||||
websockets/streams.py,sha256=PbVlfaUjsRo70fO6zOnvae-9M3Bnh2PUu43f27WHknc,4189
|
||||
websockets/sync/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
websockets/sync/__pycache__/__init__.cpython-39.pyc,,
|
||||
websockets/sync/__pycache__/client.cpython-39.pyc,,
|
||||
websockets/sync/__pycache__/compatibility.cpython-39.pyc,,
|
||||
websockets/sync/__pycache__/connection.cpython-39.pyc,,
|
||||
websockets/sync/__pycache__/messages.cpython-39.pyc,,
|
||||
websockets/sync/__pycache__/server.cpython-39.pyc,,
|
||||
websockets/sync/__pycache__/utils.cpython-39.pyc,,
|
||||
websockets/sync/client.py,sha256=WH3thAuQFsZZqBxhe1he8ds7C9sMqvghTwk34BNzT5Q,11593
|
||||
websockets/sync/compatibility.py,sha256=YAwxJLlA2i2DqV1rmIAAGT6cmOio1FfsLEbF3w520w0,576
|
||||
websockets/sync/connection.py,sha256=jstGhqTCCFHLsqj9tV4W2v2P7orz5K6Ag2WtE0ictoc,30048
|
||||
websockets/sync/messages.py,sha256=j7QdUVmQadUgygy9bwgdwYodJyyOAjFnyKfOLvV_4tc,9765
|
||||
websockets/sync/server.py,sha256=PW0KA-E4a8LSkQWGZFNPocDTdOoe6xFjCdpdJl31MZM,19190
|
||||
websockets/sync/utils.py,sha256=Pth5iuZHcoNphKnda238_YbES1W9Mnam8KTJYRhPphs,1197
|
||||
websockets/typing.py,sha256=YNw2qGqZgZTMB4kqfxincSX0xfZMT_QglvZFUXwDucs,1444
|
||||
websockets/uri.py,sha256=dppB507un7zZrxwvrVLScSFWcqqzdwV05WOxnagsYaA,3323
|
||||
websockets/utils.py,sha256=nz3tb3CXB6xtssMM2fUFDXPqHPq1XeNRFog9tAzJpPk,1201
|
||||
websockets/version.py,sha256=eT4uDoaOBjtzlK9gGA-VM6HlR8sjFtDo5SC__ryXwlg,2801
|
||||
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: bdist_wheel (0.40.0)
|
||||
Root-Is-Purelib: false
|
||||
Tag: cp39-cp39-win_amd64
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
websockets
|
||||
Reference in New Issue
Block a user