Skip to content

feat: a function to generate URI before every connecting #31

Open
@laeo

Description

@laeo

Description

I want to add the user authentication token as query param to URI, but the token has short lifetime, while trying reconnect after token expires, there is no way to update the token, it will stuck looping.

WebSocket(
  uri: () => "wss://localhost/?_token=xxxxx", // we can use the callback to retrieve valid token before connects.
);

Requirements

  • A function to generate URI before every connect happens.

Additional Context

No.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions