Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow change config after creating provider #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shincurry
Copy link

Authentication credentials (taking JWT as an example) can be placed in params.

If it is an accessToken, when the accessToken expires, we need to get a new accessToken by refresh Token, and use this new accessToken to reconnect to the Websocket server.

y-websocket use polling interval to try to reconnect when connection failed, so, allow to directly modify the config containing the token inside the WebsocketProvider instance, then the new token can be used to reconnect to server without re-creating the WebsocketProvider instance.

code changes:

  • Save serverUrl as a public property
  • Save params as a public property
  • Make url property as a readonly computed property
  • Make bcChannel property as a readonly computed property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant