Skip to content

feature/Allow async events add url mutation#34

Closed
hathamneh wants to merge 1 commit intojjxxs:masterfrom
monease:allow-async-events-add-url-edit
Closed

feature/Allow async events add url mutation#34
hathamneh wants to merge 1 commit intojjxxs:masterfrom
monease:allow-async-events-add-url-edit

Conversation

@hathamneh
Copy link
Copy Markdown

@hathamneh hathamneh commented Aug 23, 2024

This PR adds two features:

  • allow modification url after the websocket is built. ex: ws.url = 'some_new_url'
  • allow async events handlers: ex:
   WebsocketBuilder.onRetry(async (ws, ev) => {
     await someAsynTask();
   })

The use case needed those is:
We have a secured API that requires a temporary token per socket connection, so what is needed is to get a new token asynchronously then append it to the socket url:

   WebsocketBuilder.onRetry(async (ws, ev) => {
     const newToken = await someAsynTask();
     ws.url = `/myUrl?token=${newToken}`;
   })

@hathamneh hathamneh changed the title Allow async events add url mutation feature/Allow async events add url mutation Aug 23, 2024
@jjxxs
Copy link
Copy Markdown
Owner

jjxxs commented Apr 20, 2026

Thanks for the PR. But I've decided to close this, reasoning see #15.

@jjxxs jjxxs closed this Apr 20, 2026
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.

2 participants