浏览代码

upgrade to python-socketio >=5.10.0 (fixes #1809)

Falko Schindler 1 年之前
父节点
当前提交
e0f0d36595
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 2 2
      nicegui/nicegui.py
  2. 1 0
      pyproject.toml

+ 2 - 2
nicegui/nicegui.py

@@ -137,12 +137,12 @@ async def exception_handler_500(request: Request, exception: Exception) -> Respo
 
 
 @sio.on('handshake')
-def on_handshake(sid: str, client_id: str) -> bool:
+async def on_handshake(sid: str, client_id: str) -> bool:
     client = globals.clients.get(client_id)
     if not client:
         return False
     client.environ = sio.get_environ(sid)
-    sio.enter_room(sid, client.id)
+    await sio.enter_room(sid, client.id)
     handle_handshake(client)
     return True
 

+ 1 - 0
pyproject.toml

@@ -16,6 +16,7 @@ Pygments = ">=2.15.1,<3.0.0"
 uvicorn = {extras = ["standard"], version = "^0.22.0"}
 fastapi = ">=0.92,<1.0.0"
 fastapi-socketio = "^0.0.10"
+python-socketio = ">=5.9.0" # https://github.com/zauberzeug/nicegui/issues/1809
 vbuild = ">=0.8.2"
 watchfiles = ">=0.18.1,<1.0.0"
 jinja2 = "^3.1.2"