-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Description
I need to connect a socket.io that on connection will check if a specific query parameter contains a valid JWT token (which is not expired).
During the lifetime of the client using this library, the JWT token will expire. I can retrieve a fresh token which is not expired, but I need to update the url that rust-socketio uses for reconnection, otherwise reconnection will fail.
I see two different approaches for implementing this:
- Add a public
set_reconnect_url
function toClient
. - Add a
on_reconnect
function toClientBuilder
with the signaturefn(ClientBuilder) -> ClientBuilder
. Before the client tries to reconnect it will use the reconnect handler (if specified) to get a modifiedClientBuilder
. This handler can then change the url, opening headers, auth, etc...
I have implemented option 1 in #252
Metadata
Metadata
Assignees
Labels
No labels