Skip to content

overriding generateId does nothing #4190

Discussion options

You must be logged in to vote

The generateId method applies to the session ID of the low-level connection (the sid in the query parameters).

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?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by XiXiongMaoXiong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants