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

Add async transport mode #21

Merged
merged 2 commits into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions fastapi_socketio/socket_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Optional, Union
from fastapi import FastAPI


class SocketManager:
"""
Integrates SocketIO with FastAPI app.
Expand All @@ -23,9 +22,10 @@ def __init__(
mount_location: str = "/ws",
socketio_path: str = "socket.io",
cors_allowed_origins: Union[str, list] = '*',
async_mode: str = "asgi"
) -> None:
# TODO: Change Cors policy based on fastapi cors Middleware
self._sio = socketio.AsyncServer(async_mode="asgi", cors_allowed_origins=cors_allowed_origins)
self._sio = socketio.AsyncServer(async_mode=async_mode, cors_allowed_origins=cors_allowed_origins)
self._app = socketio.ASGIApp(
socketio_server=self._sio, socketio_path=socketio_path
)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup
import os

VERSION = "0.0.7"
VERSION = "0.0.8"


def get_long_description():
Expand Down