chore: 添加虚拟环境到仓库
- 添加 backend_service/venv 虚拟环境 - 包含所有Python依赖包 - 注意:虚拟环境约393MB,包含12655个文件
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,151 @@
|
||||
Metadata-Version: 2.4
|
||||
Name: wsproto
|
||||
Version: 1.3.1
|
||||
Summary: Pure-Python WebSocket protocol implementation
|
||||
Author-email: Benno Rice <benno@jeamland.net>
|
||||
Maintainer-email: Thomas Kriechbaumer <thomas@kriechbaumer.name>
|
||||
License-Expression: MIT
|
||||
Project-URL: Homepage, https://github.com/python-hyper/wsproto/
|
||||
Project-URL: Bug Reports, https://github.com/python-hyper/wsproto/issues
|
||||
Project-URL: Source, https://github.com/python-hyper/wsproto/
|
||||
Project-URL: Documentation, https://python-hyper.org/
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 3 :: Only
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
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 :: Implementation :: CPython
|
||||
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
||||
Requires-Python: >=3.10
|
||||
Description-Content-Type: text/x-rst
|
||||
License-File: LICENSE
|
||||
Requires-Dist: h11<1,>=0.16.0
|
||||
Dynamic: license-file
|
||||
|
||||
========================================================
|
||||
Pure Python, pure state-machine WebSocket implementation
|
||||
========================================================
|
||||
|
||||
.. image:: https://github.com/python-hyper/wsproto/workflows/CI/badge.svg
|
||||
:target: https://github.com/python-hyper/wsproto/actions
|
||||
:alt: Build Status
|
||||
.. image:: https://codecov.io/gh/python-hyper/wsproto/branch/main/graph/badge.svg
|
||||
:target: https://codecov.io/gh/python-hyper/wsproto
|
||||
:alt: Code Coverage
|
||||
.. image:: https://readthedocs.org/projects/wsproto/badge/?version=latest
|
||||
:target: https://wsproto.readthedocs.io/en/latest/
|
||||
:alt: Documentation Status
|
||||
.. image:: https://img.shields.io/badge/chat-join_now-brightgreen.svg
|
||||
:target: https://gitter.im/python-hyper/community
|
||||
:alt: Chat community
|
||||
|
||||
|
||||
This repository contains a pure-Python implementation of a WebSocket protocol
|
||||
stack. It's written from the ground up to be embeddable in whatever program you
|
||||
choose to use, ensuring that you can communicate via WebSockets, as defined in
|
||||
`RFC6455 <https://tools.ietf.org/html/rfc6455>`_, regardless of your programming
|
||||
paradigm.
|
||||
|
||||
This repository does not provide a parsing layer, a network layer, or any rules
|
||||
about concurrency. Instead, it's a purely in-memory solution, defined in terms
|
||||
of data actions and WebSocket frames. RFC6455 and Compression Extensions for
|
||||
WebSocket via `RFC7692 <https://tools.ietf.org/html/rfc7692>`_ are fully
|
||||
supported.
|
||||
|
||||
wsproto supports Python 3.6.1 or higher.
|
||||
|
||||
To install it, just run:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ pip install wsproto
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Let's assume you have some form of network socket available. wsproto client
|
||||
connections automatically generate a HTTP request to initiate the WebSocket
|
||||
handshake. To create a WebSocket client connection:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from wsproto import WSConnection, ConnectionType
|
||||
from wsproto.events import Request
|
||||
|
||||
ws = WSConnection(ConnectionType.CLIENT)
|
||||
ws.send(Request(host='echo.websocket.org', target='/'))
|
||||
|
||||
To create a WebSocket server connection:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from wsproto.connection import WSConnection, ConnectionType
|
||||
|
||||
ws = WSConnection(ConnectionType.SERVER)
|
||||
|
||||
Every time you send a message, or call a ping, or simply if you receive incoming
|
||||
data, wsproto might respond with some outgoing data that you have to send:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
some_socket.send(ws.bytes_to_send())
|
||||
|
||||
Both connection types need to receive incoming data:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
ws.receive_data(some_byte_string_of_data)
|
||||
|
||||
And wsproto will issue events if the data contains any WebSocket messages or state changes:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
for event in ws.events():
|
||||
if isinstance(event, Request):
|
||||
# only client connections get this event
|
||||
ws.send(AcceptConnection())
|
||||
elif isinstance(event, CloseConnection):
|
||||
# guess nobody wants to talk to us any more...
|
||||
elif isinstance(event, TextMessage):
|
||||
print('We got text!', event.data)
|
||||
elif isinstance(event, BytesMessage):
|
||||
print('We got bytes!', event.data)
|
||||
|
||||
Take a look at our docs for a `full list of events
|
||||
<https://wsproto.readthedocs.io/en/latest/api.html#events>`!
|
||||
|
||||
|
||||
Documentation
|
||||
=============
|
||||
|
||||
Documentation is available at https://wsproto.readthedocs.io/en/latest/.
|
||||
|
||||
Contributing
|
||||
============
|
||||
|
||||
``wsproto`` welcomes contributions from anyone! Unlike many other projects we
|
||||
are happy to accept cosmetic contributions and small contributions, in addition
|
||||
to large feature requests and changes.
|
||||
|
||||
Before you contribute (either by opening an issue or filing a pull request),
|
||||
please `read the contribution guidelines`_.
|
||||
|
||||
.. _read the contribution guidelines: http://python-hyper.org/en/latest/contributing.html
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
``wsproto`` is made available under the MIT License. For more details, see the
|
||||
``LICENSE`` file in the repository.
|
||||
|
||||
Authors
|
||||
=======
|
||||
|
||||
``wsproto`` was created by @jeamland, and is maintained by the python-hyper
|
||||
community.
|
||||
@@ -0,0 +1,23 @@
|
||||
wsproto-1.3.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
wsproto-1.3.1.dist-info/METADATA,sha256=YVJBpHMwBcGZ8Js5FAfosC1h3ZeiD0FbdQ1so6P1rJQ,5241
|
||||
wsproto-1.3.1.dist-info/RECORD,,
|
||||
wsproto-1.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
||||
wsproto-1.3.1.dist-info/licenses/LICENSE,sha256=wDKajb80N7CV9_XPQlfWu4VeBxIMroeGWGBz_3ppmVk,1093
|
||||
wsproto-1.3.1.dist-info/top_level.txt,sha256=BUdIrwL11zET0fkWkYRJ1yZKrEfvDF9DZqjhABOio6Y,8
|
||||
wsproto/__init__.py,sha256=v2U9f6UIaYW0HVYzhkKRumW17D_OsqGJfssUtf5S8CA,2969
|
||||
wsproto/__pycache__/__init__.cpython-313.pyc,,
|
||||
wsproto/__pycache__/connection.cpython-313.pyc,,
|
||||
wsproto/__pycache__/events.cpython-313.pyc,,
|
||||
wsproto/__pycache__/extensions.cpython-313.pyc,,
|
||||
wsproto/__pycache__/frame_protocol.cpython-313.pyc,,
|
||||
wsproto/__pycache__/handshake.cpython-313.pyc,,
|
||||
wsproto/__pycache__/typing.cpython-313.pyc,,
|
||||
wsproto/__pycache__/utilities.cpython-313.pyc,,
|
||||
wsproto/connection.py,sha256=DbEW1VJwV0nkLUSmgAsTvSviF2DSZPK307_D-h3Lqcg,7203
|
||||
wsproto/events.py,sha256=mL7QZE5D-87vbO_W_EfEOOdVQMG3nyCSUbvJCQz7130,7942
|
||||
wsproto/extensions.py,sha256=qmAGZ6VomtO1aAtqVVjKCqZZDJbWGoFJd3-KOpA-wfk,11210
|
||||
wsproto/frame_protocol.py,sha256=x0qWLhre8kd-6iMcpDWdXfafyP7vYyenFYIA4faaQmI,24083
|
||||
wsproto/handshake.py,sha256=bWq0sGt-y4LUeupTMhu-7eDTZV2e8jYVzov56ofZvBY,18582
|
||||
wsproto/py.typed,sha256=sow9soTwP9T_gEAQSVh7Gb8855h04Nwmhs2We-JRgZM,7
|
||||
wsproto/typing.py,sha256=SD8omn-rHreLdlX9rfhl-jCBWMzs0hFBL2hvxnQOnjA,72
|
||||
wsproto/utilities.py,sha256=xhGJy-tgIVSKBR4P_K9wK-W2Jt-P3u5kUy9nLPGVM3E,2869
|
||||
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: setuptools (80.9.0)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Benno Rice and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1 @@
|
||||
wsproto
|
||||
Reference in New Issue
Block a user