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

Add **kwargs to SocketManager #30

Merged
merged 1 commit into from
Jun 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions fastapi_socketio/socket_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class SocketManager:
"""
Integrates SocketIO with FastAPI app.
Integrates SocketIO with FastAPI app.
Adds `sio` property to FastAPI object (app).

Default mount location for SocketIO app is at `/ws`
Expand All @@ -23,10 +23,11 @@ def __init__(
mount_location: str = "/ws",
socketio_path: str = "socket.io",
cors_allowed_origins: Union[str, list] = '*',
async_mode: str = "asgi"
async_mode: str = "asgi",
**kwargs
) -> None:
# TODO: Change Cors policy based on fastapi cors Middleware
self._sio = socketio.AsyncServer(async_mode=async_mode, cors_allowed_origins=cors_allowed_origins)
self._sio = socketio.AsyncServer(async_mode=async_mode, cors_allowed_origins=cors_allowed_origins, **kwargs)
self._app = socketio.ASGIApp(
socketio_server=self._sio, socketio_path=socketio_path
)
Expand Down