From 7cc84bd13dfa0a86b0326446fb6954949ef948c0 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Fri, 9 Feb 2024 19:01:59 +0000 Subject: [PATCH] Option to disable routing in ASGIApp --- src/socketio/asgi.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/socketio/asgi.py b/src/socketio/asgi.py index 2394ee1e..23b094d8 100644 --- a/src/socketio/asgi.py +++ b/src/socketio/asgi.py @@ -15,7 +15,12 @@ class ASGIApp(engineio.ASGIApp): # pragma: no cover :param other_asgi_app: A separate ASGI app that receives all other traffic. :param socketio_path: The endpoint where the Socket.IO application should be installed. The default value is appropriate for - most cases. + most cases. With a value of ``None``, all incoming + traffic is directed to the Socket.IO server, with the + assumption that routing, if necessary, is handled by + a different layer. When this option is set to + ``None``, ``static_files`` and ``other_asgi_app`` are + ignored. :param on_startup: function to be called on application startup; can be coroutine :param on_shutdown: function to be called on application shutdown; can be @@ -27,7 +32,7 @@ class ASGIApp(engineio.ASGIApp): # pragma: no cover import uvicorn sio = socketio.AsyncServer() - app = engineio.ASGIApp(sio, static_files={ + app = socketio.ASGIApp(sio, static_files={ '/': 'index.html', '/static': './public', })