文件名称:flask-sockets:适用于Flask应用程序的优雅WebSockets
文件大小:5KB
文件格式:ZIP
更新时间:2024-03-19 21:19:43
Python
烧瓶插座 适用于Flask应用程序的优雅WebSocket。 route装饰器的简单用法: from flask import Flask from flask_sockets import Sockets app = Flask ( __name__ ) sockets = Sockets ( app ) @ sockets . route ( '/echo' ) def echo_socket ( ws ): while not ws . closed : message = ws . receive () ws . send ( message ) @ app . route ( '/' ) def hello (): return 'Hello World!' if __name__ == "__main__" : fro
【文件预览】:
flask-sockets-master
----README.rst(4KB)
----LICENSE(1KB)
----flask_sockets.py(4KB)
----setup.py(1005B)
----.gitignore(514B)