Description
Describe the bug
Hi Peeps,
I am facing an issue where the sockets are in polling mode, the engine io long-polling algorithm will error out when you have two open GET requests. As of now, the error is treated as 500 error.
This could happen when a client has a faulty configuration in place. So, I am proposing we should treat this error as 400/406/409 code where it is used to tell the client that a fault has taken place on THEIR side.
engine.io/lib/transports/polling.ts
Lines 115 to 122 in 4c306af
To Reproduce
The issue is similar to #166 but restricted to polling only. No upgrade to WebSocket is allowed in my case.
You can reproduce the issue in the following ways
- Using a reverse proxy to proxy WebSocket
reproduced
- Use a browser(firefox) to block WebSocket transport
reproduced
- Using a socket client to proxy WebSocket:
not-reproduced
transports: [ "polling"]
Once the browser shows the xhr requests(GET) as pending state, copy the request as curl. Execute the curl request via the terminal to reproduce the issue.
Engine.IO client version: 6.1.0
Expected behavior
it indicates a faulty implementation of the engine io long-polling algorithm when you have two open GET requests. The proposed Idea is that we could downgrade data request overlap from client
error code listed below as 4xx error instead of 500
engine.io/lib/transports/polling.ts
Line 119 in 4c306af
potential error codes - 400/406/409
Thanks!