Tutorial¶
This tutorial builds a small Socket.IO chat server inside a Django project. It uses one Socket.IO namespace, one room, browser JavaScript as the first client, and optional Python tests at the end.
What you will build¶
By the end you will have:
a Django project configured for Channels and
django-sio;a
ChatConsumermounted at the Socket.IO path/socket.io;a
/chatnamespace;a
lobbyroom;a
chat_messageevent with acknowledgement support;browser client code using the official Socket.IO JavaScript client;
a basic integration-test pattern using
python-socketio.AsyncClient.