How can I serve a websockets endpoint from Flask running on Python 3? This seems near impossible. Note, I do not want SocketsIO or anything like that. Just want to be able, from plain JavaScript following the very simple HTML5 standard, connect to to a Flask endpoint and upgrade it to a Websocket for bidirectional communication. Example JS below
var ws = new WebSocket("ws://localhost:5000/echo");
I assumed this would be a simple matter of pip install
ing the right module, but no. Any ideas? Should I write my own Python module for this?
Unfortunately this is currently not supported. Possible workarounds below
flask-sockets
module, issue here . 您是否查看过Flask-SocketIO提供的功能?
pip install flask-socketio
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.