Description
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
- http-proxy-middleware: 0.17.1
- http-proxy-middleware configuration: websocket proxy with external websocket upgrade being invoked
- server: express proxying to jersey
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.