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

Commit

Permalink
Add **kwargs to SocketManager
Browse files Browse the repository at this point in the history
Pass these to socketio.AsyncServer.
  • Loading branch information
adamlwgriffiths committed Jun 16, 2022
1 parent 3dd1f3d commit a531f49
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit a531f49

Please sign in to comment.