We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have set my transports to use WebSocket first and then fallback to polling e.g. transports: ["websocket", "polling"].
transports: ["websocket", "polling"]
To test if the fallback transport really works, I used TamperMonkey browser extension to disable Websocket by setting WebSocket = void 0.
WebSocket = void 0
Instead of switching to polling, I keep getting connect_error with the message timeout from websocket transport.
connect_error
timeout
Tried to investigate and it looks like transport switching only works if createTransport method throws here:
createTransport
engine.io-client/lib/socket.ts
Lines 467 to 474 in fa47916
But the method always returns a transport wrapper class, even when WebSocket is not defined.
WebSocket
To Reproduce
Engine.IO server version: 6.5.2
6.5.2
Server
const engine = require("engine.io"); const server = engine.listen(3000, { transports: ["polling", "websocket"] }); server.on("connection", (socket) => { console.log("connection"); socket.on("message", (data) => { console.log("data", data); }); socket.on("close", () => { console.log("close"); }); });
Engine.IO client version: 6.5.2
Client
const socket = require("engine.io-client")("ws://localhost:3000", { transports: ["websocket", "polling"] }); socket.on("open", () => { console.log("open"); socket.on("message", (data) => { console.log("data", data); }); socket.on("close", () => { console.log("close"); }); });
Expected behavior
Should be able to fallback to polling transport when WebSocket transport is disabled on the browser.
Platform:
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have set my transports to use WebSocket first and then fallback to polling e.g.
transports: ["websocket", "polling"]
.To test if the fallback transport really works, I used TamperMonkey browser extension to disable Websocket by setting
WebSocket = void 0
.Instead of switching to polling, I keep getting
connect_error
with the messagetimeout
from websocket transport.Tried to investigate and it looks like transport switching only works if
createTransport
method throws here:engine.io-client/lib/socket.ts
Lines 467 to 474 in fa47916
But the method always returns a transport wrapper class, even when
WebSocket
is not defined.To Reproduce
Engine.IO server version:
6.5.2
Server
Engine.IO client version:
6.5.2
Client
Expected behavior
Should be able to fallback to polling transport when WebSocket transport is disabled on the browser.
Platform:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: