Timothy J. Baek 7 months ago
parent
commit
657d443a3e
1 changed files with 10 additions and 1 deletions
  1. 10 1
      backend/open_webui/apps/socket/main.py

+ 10 - 1
backend/open_webui/apps/socket/main.py

@@ -12,7 +12,16 @@ from open_webui.utils.utils import decode_token
 
 if WEBSOCKET_MANAGER == "redis":
     mgr = socketio.AsyncRedisManager(WEBSOCKET_REDIS_URL)
-    sio = socketio.AsyncServer(client_manager=mgr)
+    sio = socketio.AsyncServer(
+        cors_allowed_origins=[],
+        async_mode="asgi",
+        transports=(
+            ["polling", "websocket"] if ENABLE_WEBSOCKET_SUPPORT else ["polling"]
+        ),
+        allow_upgrades=ENABLE_WEBSOCKET_SUPPORT,
+        always_connect=True,
+        client_manager=mgr,
+    )
 else:
     sio = socketio.AsyncServer(
         cors_allowed_origins=[],