Replies: 1 comment 1 reply
-
That sounds like a bug in the 2.x client. Let me check. |
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
-
I notice a different behavior between 2.x client and 4.x client when authenticate fails,
When authenticate fails and the socket.io server throw an Error in middleware, e,g,
next(new Error("Invalid token"));
(refer to https://socket.io/docs/v4/middlewares/#sending-credentials). The 4.x client will stop reconnect.I think this is the connect behavior but for the 2.x client it will try to reconnect (at the next
pinginterval
) . But with the same incorrect credentials, the server will reject again but reconnect continues.I think it is quite pointless to reconnect in this case so I think it is a bug for 2.x client code. But is there any particular reason why 2.x does it this way ?
Beta Was this translation helpful? Give feedback.
All reactions