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

Commit

Permalink
Merge pull request #30 from adamlwgriffiths/add-kwargs
Browse files Browse the repository at this point in the history
Add **kwargs to SocketManager
  • Loading branch information
pyropy authored Jun 16, 2022
2 parents 3dd1f3d + a531f49 commit 0763748
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 0763748

Please sign in to comment.