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

Commit 0763748

Browse files
authored
Merge pull request #30 from adamlwgriffiths/add-kwargs
Add **kwargs to SocketManager
2 parents 3dd1f3d + a531f49 commit 0763748

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fastapi_socketio/socket_manager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class SocketManager:
77
"""
8-
Integrates SocketIO with FastAPI app.
8+
Integrates SocketIO with FastAPI app.
99
Adds `sio` property to FastAPI object (app).
1010
1111
Default mount location for SocketIO app is at `/ws`
@@ -23,10 +23,11 @@ def __init__(
2323
mount_location: str = "/ws",
2424
socketio_path: str = "socket.io",
2525
cors_allowed_origins: Union[str, list] = '*',
26-
async_mode: str = "asgi"
26+
async_mode: str = "asgi",
27+
**kwargs
2728
) -> None:
2829
# TODO: Change Cors policy based on fastapi cors Middleware
29-
self._sio = socketio.AsyncServer(async_mode=async_mode, cors_allowed_origins=cors_allowed_origins)
30+
self._sio = socketio.AsyncServer(async_mode=async_mode, cors_allowed_origins=cors_allowed_origins, **kwargs)
3031
self._app = socketio.ASGIApp(
3132
socketio_server=self._sio, socketio_path=socketio_path
3233
)

0 commit comments

Comments
 (0)