overriding generateId does nothing #4190
Answered
by
darrachequesne
XiXiongMaoXiong
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
darrachequesne
Nov 30, 2021
Replies: 1 comment
-
The You can indeed override the Socket.IO id in a middleware before the connection: io.use((socket, next) => {
socket.id = "...";
next();
}); This isn't really documented because it's not a frequent use case, could you please explain yours? |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
XiXiongMaoXiong
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
generateId
method applies to the session ID of the low-level connection (thesid
in the query parameters).You can indeed override the Socket.IO id in a middleware before the connection:
This isn't really documented because it's not a frequent use case, could you please explain yours?