Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit a7c4b77

Browse files
committed
Add async transport mode
1 parent c97f4cb commit a7c4b77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fastapi_socketio/socket_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from typing import Optional, Union
33
from fastapi import FastAPI
44

5-
65
class SocketManager:
76
"""
87
Integrates SocketIO with FastAPI app.
@@ -23,9 +22,10 @@ def __init__(
2322
mount_location: str = "/ws",
2423
socketio_path: str = "socket.io",
2524
cors_allowed_origins: Union[str, list] = '*',
25+
async_mode: str = "asgi"
2626
) -> None:
2727
# TODO: Change Cors policy based on fastapi cors Middleware
28-
self._sio = socketio.AsyncServer(async_mode="asgi", cors_allowed_origins=cors_allowed_origins)
28+
self._sio = socketio.AsyncServer(async_mode=async_mode, cors_allowed_origins=cors_allowed_origins)
2929
self._app = socketio.ASGIApp(
3030
socketio_server=self._sio, socketio_path=socketio_path
3131
)

0 commit comments

Comments
 (0)