Skip to content

Updating URL in between onClose reconnects #57

Closed
@redi-tjandr

Description

@redi-tjandr

So I have a case where my URL contains an OAuth token (for authentication), kind of like this:

ws://localhost:8080/myapp/webapi/subscriptions?bearer_token=aba58cfd6ecbb9532e6308683d2accbd

It is possible that the session gets closed because the token is invalid (due to a timed out access token). In this case I would want to refresh my access token, update the URL and then try again to reconnect. I think, if we add an optional callback that this framework allowed to update the URL in between reconnects that would solve the problem. Something like this:

"function setUrlBetweenReconnects() {
... callback code here
}"

Or alternatively, if we specify an optional parameter string, that can be updated between reconnects, so initially I would set parameters to be "bearer_token=aba58cfd6ecbb9532e6308683d2accbd" and then in between reconnects you call "updateParameters()" which calls a method I set/override.

Any of this seem reasonable or can you think of a better way to solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions