Skip to content

How do I update query/auth on connect? #3902

Discussion options

You must be logged in to vote

You can update those options in the "reconnect_attempt" event:

socket.io.on("reconnect_attempt", () => {
  socket.io.opts.query.token = 123;
  socket.auth.token = 456;
});

Please note that the query option will be shared between the Socket instances of the same connection.

Reference:

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@FerusAndBeyond
Comment options

@FerusAndBeyond
Comment options

@darrachequesne
Comment options

@FerusAndBeyond
Comment options

Answer selected by FerusAndBeyond
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