问题描述
我正在使用 python socket io 和 eventlet 库创建 wsgi 服务器。我正在使用套接字 io 库来利用网络套接字。这是我在服务器端的代码:
import eventlet
import eventlet.wsgi
import socketio
static_files = {
'/': './public/index.html','/public/style.css' : './public/style.css','/public/index.js' : './public/index.js',}
sio = socketio.AsyncServer(cors_allowed_origins=['*'])
app = socketio.WsgiApp(sio,static_files=static_files)
eventlet.wsgi.server(eventlet.listen(('',8080)),app)
在我在浏览器上运行时通过 websocket 连接的 js 代码中:
const socket = io("http://localhost:8080");
从浏览器连接到 localhost:8080 后出现错误;该网站已提供服务,但服务器崩溃并显示以下错误(“TypeError: 'coroutine' object is not iterable”): 我该如何解决这个问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)