Documentation
¶
Overview ¶
Example: Socket.IO server with handshake auth, listener-side payload.Ack, server-initiated EmitWithAckTimeout, and graceful Shutdown(ctx) on SIGINT/SIGTERM.
Client (socket.io-client v4):
const s = io("http://localhost:3000", {
path: "/ws",
transports: ["websocket"],
auth: { token: "secret" },
});
s.emit("hello", "world", (reply) => console.log("ack:", reply));
s.on("ping", (n, cb) => cb("pong-" + n));
Click to show internal directories.
Click to hide internal directories.