Replies: 1 comment
-
UPD: In my code it looks like (we use Nest.js as backend framework) afterInit(server: Server) {
server.use(async (socket, next) => {
const username = getUsernameFromSocket(socket);
socket.join(username);
next();
});
server.serverSideEmit('server.init'); // Sending service message helps
} |
Beta Was this translation helpful? Give feedback.
-
We have several Socket.io servers deployed in k8s clusters and working concurrently. We use Postgres Adapter. Clients connect to websocket server randomly. And for business purposes we need to detect if any user online right now. That's why we need to
fetchSockets()
and send some message likeping
with acknowlegement.And the problem I encountered with is:
Beta Was this translation helpful? Give feedback.
All reactions