API Docs
Offline
API documentation
Socket.IO real-time API with MySQL-backed event logging. Everything runs on one origin — the socket server, the REST API, and this dashboard.
Connect
Path:
/socket.ioimport { io } from "socket.io-client";
const socket = io("https://your-domain.com", { path: "/socket.io" });
socket.on("connect", () => {
console.log("connected as", socket.id);
socket.emit("join", { room: "lobby" }, (ack) => console.log("joined", ack));
});
socket.on("message", (msg) => console.log("message received:", msg));
socket.on("system", (evt) => console.log("system event:", evt));
socket.emit("message", { room: "lobby", text: "hello!" }, (ack) => {
console.log("send ack:", ack);
});Client → Server events
| Event | Payload | Description |
|---|---|---|
| join | { room: string } | Joins a room. Ack: { ok, room }. |
| leave | { room: string } | Leaves a room. Ack: { ok, room }. |
| message | { room?: string, ...fields } | Sends a message, broadcast to the room (or everyone if no room). Max 32 KB. Ack: { ok }. |
Server → Client events
| Event | Payload | Description |
|---|---|---|
| message | { from, room?, ...fields, serverReceivedAt } | Broadcast for a client message. |
| system | { type: "user_joined" | "user_left", socketId, room } | Sent to room members on join/leave. |