-
Beta Was this translation helpful? Give feedback.
Answered by
MalekD5
Feb 20, 2024
Replies: 1 comment 1 reply
-
|
Hi! Which kind of middleware are you using?
io.use((socket, next) => {
// ...
});Reference: https://socket.io/docs/v4/server-api/#serverusefn
io.on("connection", (socket) => {
socket.use(([event, ...args], next) => {
// ....
});
});Reference: https://socket.io/docs/v4/server-api/#socketusefn |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Hi, as it turns out I was incorrectly inferring the types by using
Sockettype instead ofServertype. This confusion was related to nestjs websocket package that was using the typeanyfor the lifecycle hooks (afterInitto be precise) not realizing that the parameter was referring to a server rather than a client (Socket).I think I should have been asking for support directly from nestjs rather than socket.io
My apologies.