Skip to content

Socket.io

WebSocket Namespace

WebSocket routes are defined in the sockets folder.

Chat Namespace

director.entrypoint.api.socket_io.ChatNamespace

Bases: Namespace

Chat namespace for socket.io

on_chat

on_chat(message)

Handle chat messages

Source code in backend/director/entrypoint/api/socket_io.py
def on_chat(self, message):
    """Handle chat messages"""
    chat_handler = ChatHandler(
        db=load_db(os.getenv("SERVER_DB_TYPE", app.config["DB_TYPE"]))
    )
    chat_handler.chat(message)