Live Socket.IO API
A Socket.IO API that logs itself.
Rooms, messages, and broadcasts over Socket.IO — with every connect, join, and message written to MySQL automatically. REST API, live dashboard, and a browser playground included.
client.ts
import { io } from "socket.io-client";
const socket = io("https://your-domain.com", {
path: "/socket.io",
});
socket.on("connect", () => {
socket.emit("join", { room: "lobby" });
});
socket.on("message", (msg) => {
console.log(msg); // also written to MySQL
});Not a mockup — this is the same data your dashboard sees, live
Everything the API does
A complete real-time backend, not just a socket handler.
How it works
Three steps from connection to queryable history.
01
Connect
Point socket.io-client at your domain. No separate port to configure.
const socket = io("https://your-domain.com", {
path: "/socket.io",
});02
Join & send
Join a room and emit a message — both get acknowledged and logged.
socket.emit("join", { room: "lobby" });
socket.emit("message", {
room: "lobby",
text: "hello!",
});03
Query it back
Every event is already in MySQL, queryable through the REST API.
curl "https://your-domain.com/api/logs?room=lobby&limit=20"See your events flow in, live.
The dashboard is already running — connect a socket and watch it show up.