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

Feature/allow headers update #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shalom-aviv
Copy link
Contributor

Example of changes for #99

@FZambia
Copy link
Member

FZambia commented Apr 1, 2024

Hello @shalom-aviv

Thanks for opening PR and investigating the solution.

Could you please show how you are planning to use this in real code? What will be a trigger for headers update in practice? I generally understand the need in updating headers dynamically, but I am not sure yet what is the best approach for this. So some real-life code could help me to understand.

@shalom-aviv
Copy link
Contributor Author

Hello @shalom-aviv

Thanks for opening PR and investigating the solution.

Could you please show how you are planning to use this in real code? What will be a trigger for headers update in practice? I generally understand the need in updating headers dynamically, but I am not sure yet what is the best approach for this. So some real-life code could help me to understand.

In my case, obtaining a new token can be done synchronously, so the changes in the this pull request were sufficient. Overall, I wanted to assess the feasibility and scope of changes required for parameter updates.

In a real scenario, obtaining a new token would be asynchronous. I've looked into how you handle JWT token updates and I think adding the ability to update connection settings in a similar manner would be a natural fit.

To be able to determine .upgradeError and obtain the actual status code from the server, I had to make WSError public, but this only applies to StarscreamWebSocket.

Check changes here: shalom-aviv#1

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