-
Notifications
You must be signed in to change notification settings - Fork 853
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
Concurrent websocket requests do not get upgraded #335
Comments
Sounds plausible; the debounce might cause issues with concurrent upgrade requests. I'm currently away and won't be able to investigate / work on it. Do you mind trying to create a fix for this issue? |
I can confirm that two calls to proxy.ws() on the same socket object gives the error described in #57. Namely, I see two options for solving:
|
Sorry for the late reply @jrust. I removed the debounce, hopefully it'll solve the concurrent issue. Just published a beta version.
|
Hi @jrust It would be really nice if you can verify the fix. |
Found an issue in the previous fix. Published a new beta: |
Sorry, I've been swamped, but should have some time this week and will report back. |
Hi, I've tested 0.20.0-beta.2 and found it working well -- able to start up multiple concurrent websockets without issue. Thanks for your work on this! |
I'll try to push a new version this weekend. Thanks for reporting the issue and verifying the fix! |
Hi Chimurai, |
Found a tiny bug in #344. |
Hi @jrust. Still facing the bug. Was wondering which of the two options you were using to enable WebSockets. Currently was thinking to make the manual |
What is the bug you are finding? We are using both the
Given that we are just using the |
Think I've found it. Issue was reproducible with the ws example in the repo + Safari. http calls (like Somehow Safari kept requesting /favicon.ico and Chrome didn't |
Just released a new version to npm: @jrust Thanks for reporting this issue and helping out. |
The fact that debounce could cause issues with simultaneous requests was noted in #112, but since that turned out to be a different issue, I thought it best to create a separate issue. @chimurai noted in that ticket that debounce could cause issues, and in a local setup where we have several headless browsers all connecting frequently I saw the problem of debounce causing some websockets never to be upgraded. Debounce was added to solve #57, and so this issue is to ask if there is an alternative method or a workaround? The end-result is that the proxy is not reliable when simultaneous websockets are being created by different clients.
Expected behavior
Websockets should always get upgraded, even if created concurrently.
Actual behavior
Because the upgrade handler is debounced only the last one gets upgraded. This causes the other websockets to never finish initializing.
Setup
Reproducible Demo
I am able to repro by launching multiple browser tabs simultaneously and having each create a websocket connection. Unfortunately, it's part of a larger system so I don't have a script to demonstrate.
The text was updated successfully, but these errors were encountered: