# 當直接使用 ```py sockets=Sockets(app) @sockets.route('/hello',websocket=True) def onHello(ws): pp('onHello') while not ws.closed: msg=ws.receive() print(msg) data = datetime.datetime.now() ws.send(str(data)) ``` 會產生**WebsocketMismatch**錯誤,所以需要修改 |連結標題|連結網址|功能說明| |-|-|-| |Python基于Flask框架实现Websocket通信(待更新)|https://blog.csdn.net/qq_47452807/article/details/124460225 |簡體中文說明如何實做,但會碰到Flask/flask_sockets/Werkzeug版本等等錯誤。| |Set websocket=True for Rule|https://github.com/heroku-python/flask-sockets/pull/82/commits/b33c5798151ad8efdf1553d5925c699940231b37|需要修改flask_sockets原始碼(pip install 下來的東西)|
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up