first commit

This commit is contained in:
linkitapps
2026-09-14 23:22:10 +09:00
commit 9f9c8fb69b
4207 changed files with 1333187 additions and 0 deletions
@@ -0,0 +1 @@
pip
@@ -0,0 +1,170 @@
Metadata-Version: 2.4
Name: websockets
Version: 17.1
Summary: An implementation of the WebSocket Protocol (RFC 6455 & 7692)
Author-email: Aymeric Augustin <aymeric.augustin@m4x.org>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/python-websockets/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/python-websockets/websockets/issues
Keywords: WebSocket
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.11
Description-Content-Type: text/x-rst
License-File: LICENSE
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
.. image:: logo/horizontal.svg
:width: 480px
:alt: websockets
|licence| |version| |pyversions|
.. |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
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.
Implementations on top of ``threading`` and ``trio`` are also provided, as well
as a Sans-I/O layer for integration in third-party projects.
`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.asyncio.server import serve
async def echo(websocket):
async for message in websocket:
await websocket.send(message)
async def main():
server = await serve(echo, "localhost", 8765)
await server.serve_forever()
asyncio.run(main())
Here's how a client sends and receives messages with the ``threading`` API:
.. code:: python
#!/usr/bin/env python
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 + WebSocket servers
that build on top of ``websockets`` to support WebSocket connections, like
uvicorn_ or Sanic_.
.. _uvicorn: https://www.uvicorn.org/
.. _Sanic: https://sanic.dev/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/python-websockets/websockets/issues/new
.. _pull request: https://github.com/python-websockets/websockets/compare/
Participants must uphold the `Contributor Covenant code of conduct`_.
.. _Contributor Covenant code of conduct: https://github.com/python-websockets/websockets/blob/main/CODE_OF_CONDUCT.md
``websockets`` is released under the `BSD license`_.
.. _BSD license: https://github.com/python-websockets/websockets/blob/main/LICENSE
@@ -0,0 +1,116 @@
../../Scripts/websockets.exe,sha256=_X6XYC1cIdRoehGtCMjHTlj--gOgxvy1KA1S3sRHhNU,108403
websockets-17.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
websockets-17.1.dist-info/METADATA,sha256=zhsrHN6cJoHT0DKKckGTR1Q2viOP1H2L2GaoGVs1Vj8,6510
websockets-17.1.dist-info/RECORD,,
websockets-17.1.dist-info/WHEEL,sha256=Va1ecE4aQlcxybZkcSvh2FeN1_DlC8IaJNJJsCJYEj0,101
websockets-17.1.dist-info/entry_points.txt,sha256=Dnhn4dm5EsI4ZMAsHldGF6CwBXZrGXnR7cnK2-XR7zY,51
websockets-17.1.dist-info/licenses/LICENSE,sha256=D0RRSZisognTSC0QIEqK3yqkKW_xV6NqXAki8igGMtM,1538
websockets-17.1.dist-info/top_level.txt,sha256=CMpdKklxKsvZgCgyltxUWOHibZXZ1uYIVpca9xsQ8Hk,11
websockets/__init__.py,sha256=vQHP5G4rtKDXEpSFZLPny_idjboIWv5r_9bAVhdiVmE,7699
websockets/__main__.py,sha256=h1QpgvR08tO6TfQHuySKKgQiQVXVIoQRKLEx5sVht_M,67
websockets/__pycache__/__init__.cpython-311.pyc,,
websockets/__pycache__/__main__.cpython-311.pyc,,
websockets/__pycache__/auth.cpython-311.pyc,,
websockets/__pycache__/cli.cpython-311.pyc,,
websockets/__pycache__/client.cpython-311.pyc,,
websockets/__pycache__/connection.cpython-311.pyc,,
websockets/__pycache__/datastructures.cpython-311.pyc,,
websockets/__pycache__/exceptions.cpython-311.pyc,,
websockets/__pycache__/frames.cpython-311.pyc,,
websockets/__pycache__/headers.cpython-311.pyc,,
websockets/__pycache__/http11.cpython-311.pyc,,
websockets/__pycache__/imports.cpython-311.pyc,,
websockets/__pycache__/protocol.cpython-311.pyc,,
websockets/__pycache__/proxy.cpython-311.pyc,,
websockets/__pycache__/server.cpython-311.pyc,,
websockets/__pycache__/streams.cpython-311.pyc,,
websockets/__pycache__/typing.cpython-311.pyc,,
websockets/__pycache__/uri.cpython-311.pyc,,
websockets/__pycache__/utils.cpython-311.pyc,,
websockets/__pycache__/version.cpython-311.pyc,,
websockets/asyncio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
websockets/asyncio/__pycache__/__init__.cpython-311.pyc,,
websockets/asyncio/__pycache__/client.cpython-311.pyc,,
websockets/asyncio/__pycache__/connection.cpython-311.pyc,,
websockets/asyncio/__pycache__/messages.cpython-311.pyc,,
websockets/asyncio/__pycache__/router.cpython-311.pyc,,
websockets/asyncio/__pycache__/server.cpython-311.pyc,,
websockets/asyncio/client.py,sha256=G0TEXOnZT0Lpm4_oZGIRRDB48b8_bv14XyhM0wyjg6E,31347
websockets/asyncio/connection.py,sha256=w6ygAY7vpYh3d25xZTupBN06HRVrL202wf7sY8intYw,50996
websockets/asyncio/messages.py,sha256=nUTIS5qj6k043A_t69j_43QklSwUXuhDbBgMASJQUXg,11412
websockets/asyncio/router.py,sha256=LclmayDF8nep2SB9HUjO9DNIP7e4XqdtukYvPSko_LQ,8011
websockets/asyncio/server.py,sha256=hTRNY9Jtk5_gTdrGqqgPe8uoeLVYDH5SykCjkdL7HOA,35037
websockets/auth.py,sha256=NZ60zoE10wklboBHzj4Wof9piVB09jO1bDn_KHN8ZcE,586
websockets/cli.py,sha256=eRNYm8U2_JLK_Z2nGwmI2BcXUrP0WaJavrIW4G0oZ9Q,7119
websockets/client.py,sha256=tVgaFHnshw6mGJpryY3BDgxtvh03a5gDAmBRETM51Bc,16587
websockets/connection.py,sha256=uIRi5jeS3zVIWq8DcEDJPousrYNTItPe0ioKxBr2hOs,335
websockets/datastructures.py,sha256=GfaVseBRlwYZ2fCVJkuAbv3mm0-IttIExPBGpdMlshM,7463
websockets/exceptions.py,sha256=7EWhWMpGS7jyOULTL4-Kd722CyU85DPy2wnTJ-aOHBc,14847
websockets/extensions/__init__.py,sha256=HdQaQhOVkCR5RJVRKXG5Xmb6cMpAhLaKgRikYRzO64E,102
websockets/extensions/__pycache__/__init__.cpython-311.pyc,,
websockets/extensions/__pycache__/base.cpython-311.pyc,,
websockets/extensions/__pycache__/permessage_deflate.cpython-311.pyc,,
websockets/extensions/base.py,sha256=Je1VMBHq7_gqq5idsCqMPD87CI6m7zpDSRj_lCL37Rc,3026
websockets/extensions/permessage_deflate.py,sha256=G-pvBzOe-6J3NPK2tz1sXgVI4z6Ub7mJBtc05boZxrg,26541
websockets/frames.py,sha256=1RgHu2DVthswDBXpY2JMifkVVgnK1vftZPlr0F8x-zo,17253
websockets/headers.py,sha256=2XFbUE0BzEIftBR2KS2ygeSRIYzPB-a-q35jfdcZ1MA,16632
websockets/http11.py,sha256=aBreFKAKQCjXWQZdqILwJHMr1A4jAKuVwX1GDK4GsJU,18738
websockets/imports.py,sha256=oFdWkxypj_diuqneRuA5OWEXLMQ6pAtj-rKqFU6Pmdg,2895
websockets/legacy/__init__.py,sha256=VS5mRP7oS3kXCcXX7F3vPULmXPFi4VcyKbnv8Lk18MY,287
websockets/legacy/__pycache__/__init__.cpython-311.pyc,,
websockets/legacy/__pycache__/auth.cpython-311.pyc,,
websockets/legacy/__pycache__/client.cpython-311.pyc,,
websockets/legacy/__pycache__/exceptions.cpython-311.pyc,,
websockets/legacy/__pycache__/framing.cpython-311.pyc,,
websockets/legacy/__pycache__/handshake.cpython-311.pyc,,
websockets/legacy/__pycache__/http.cpython-311.pyc,,
websockets/legacy/__pycache__/protocol.cpython-311.pyc,,
websockets/legacy/__pycache__/server.cpython-311.pyc,,
websockets/legacy/auth.py,sha256=wILIJE28YsQKmQcWdPMzmdM_0Sw674dqUo2XGqyUvH4,6721
websockets/legacy/client.py,sha256=O7XKQE_C0nrTW7SJxsy8riKQ60mXzrrIwYLul7NBJJA,27935
websockets/legacy/exceptions.py,sha256=KrvUEI31DUZs3gl6M-Q-dgsSnsMXzU_bDRuHU6AcKbc,1995
websockets/legacy/framing.py,sha256=hR1BBzT4UMl_1zOmlm1tPjdtfnHTAhPevRFYEE-9itc,6598
websockets/legacy/handshake.py,sha256=CRRxkJ96TIgWuoMIL0iol4jp4X7llMA8buX4gfo0SwE,5443
websockets/legacy/http.py,sha256=OPu_UljFJH74nxk5V-jnOOkqzdXcpJ6M0LynIpuZ740,7262
websockets/legacy/protocol.py,sha256=p2ILhr5nInrRnKPDEtatgVYWamE4_ItN_kP04_aGH4U,65282
websockets/legacy/server.py,sha256=40fgshk1STwY7Z4GLVmBkREszQVznOCvnaF_iJ6PUVw,46016
websockets/protocol.py,sha256=OtZoM6Dh8pF3ijs9AEbKlUSc4A-sbJnvTTARkk2Cafc,27972
websockets/proxy.py,sha256=Vx6ChvQlavAZ2DkzlmoEw5I5e7alDqBCISi_xZotAS0,5119
websockets/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
websockets/server.py,sha256=Z10tmesqxNj9LhKl7cZIv1QACJnbUzBXojrbTnOnWdA,25336
websockets/speedups.c,sha256=cWPv8E0JKXSneV8b732dwNEbyD5JWJKzyI5bqmGiXaY,6149
websockets/speedups.cp311-win_amd64.pyd,sha256=-0LETdKfFWN2jjahby5CbaLWt4xpJbVd5gSxehoosig,11264
websockets/speedups.pyi,sha256=xJUwsMLc11sH19lvnxlmuwROSIxzQYdvN3Qt5zS0674,105
websockets/streams.py,sha256=pP55__xWn6xuQCud0uCjnBF_bKult_4AlItBjtnE7N4,4777
websockets/sync/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
websockets/sync/__pycache__/__init__.cpython-311.pyc,,
websockets/sync/__pycache__/client.cpython-311.pyc,,
websockets/sync/__pycache__/connection.cpython-311.pyc,,
websockets/sync/__pycache__/messages.cpython-311.pyc,,
websockets/sync/__pycache__/router.cpython-311.pyc,,
websockets/sync/__pycache__/server.cpython-311.pyc,,
websockets/sync/__pycache__/utils.cpython-311.pyc,,
websockets/sync/client.py,sha256=06_4UBrGmgmMvOxT9XFI8P9i-B-99_53CfRxePus3GI,41032
websockets/sync/connection.py,sha256=e_47zG9ruPPfub7nytymQcKNB2YZyHj0Andin3U0pUg,49916
websockets/sync/messages.py,sha256=SKD1cMArY_Ckh2wFx0J8yyEHNiMo9SofJeGX05qewFw,13174
websockets/sync/router.py,sha256=CRYNM_AcBAkzHpkwmdwXAhLa5GsXL5E5vTSBi6YldNs,7426
websockets/sync/server.py,sha256=ZDfkDyWu3q-fkHcyOECrmk99dJMjleb88Ot5PdRnWj0,35355
websockets/sync/utils.py,sha256=JgQVxO_NcQXZd8m6hDeXpSQ_uN6GYF8u9XLHZ7msv3k,1152
websockets/trio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
websockets/trio/__pycache__/__init__.cpython-311.pyc,,
websockets/trio/__pycache__/client.cpython-311.pyc,,
websockets/trio/__pycache__/connection.cpython-311.pyc,,
websockets/trio/__pycache__/messages.cpython-311.pyc,,
websockets/trio/__pycache__/router.cpython-311.pyc,,
websockets/trio/__pycache__/server.cpython-311.pyc,,
websockets/trio/__pycache__/utils.cpython-311.pyc,,
websockets/trio/client.py,sha256=mCcvqMDkXO0OB5eujr6HSQFpXyqjaec-Q83bPRQyKpM,30997
websockets/trio/connection.py,sha256=O69JEVeBjRfPJGT3yEsA599-zB3Fb0ymJfMiuz8U9gE,50503
websockets/trio/messages.py,sha256=JvikjM_-yX_ciJVsl2jZVsApAu0nEvlXUSEgCrQC4J4,10767
websockets/trio/router.py,sha256=XrUsxHiN-6qY-0AHFokKrztBp9FcSRWGBN3oFn_8dhI,7403
websockets/trio/server.py,sha256=UBsEiepn56-Wv87QqLEdNgZlJpPLYmDFySFj7UQu12s,26463
websockets/trio/utils.py,sha256=OCYM76NkKq32hKmu1C9LibNrUQ6spABFwzHVQC2QFcE,992
websockets/typing.py,sha256=vaXqi-_ehflYIFvETaTjp_7QQaWQVLUNSQnu_J9E5CA,1913
websockets/uri.py,sha256=gohMr47baKGfjhydsaOE1sc8FH_7B8f10SdunNqY2p0,3232
websockets/utils.py,sha256=DsLsUjT1hUSWXjZr5a1gMxy-icUydcXQL8eOn0Rwoi4,2098
websockets/version.py,sha256=Wq70AIeFPVrGEqHKVwR7ECG6KWin68Kl7xAI3rrl5Qg,3294
@@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: setuptools (84.0.0)
Root-Is-Purelib: false
Tag: cp311-cp311-win_amd64
@@ -0,0 +1,2 @@
[console_scripts]
websockets = websockets.cli:main
@@ -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 @@
websockets