You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to connect with websocket transport first and if it fails I was hoping socketio would switch to long-polling. But for some reason, it keeps reconnecting with websocket transport and never switches to polling.
To Reproduce
Socket.IO server version: 4.7.2
Server
const{ Server }=require("socket.io");constexpress=require("express");consthttp=require("http");constserver=http.createServer(express());constio=newServer({transports: ["polling","websocket"],});io.on("connection",socket=>{console.log("New Connection");});io.attach(server);server.listen(3000);
Expected behavior
Was expecting the transport would switch to long-polling when websocket isn't available.
Platform:
Device: Firefox 120
OS: Windows 10
Additional context
I disabled websocket by blocking websocket calls using the Firefox request blocking feature. Can be disabled using this TamperMonkey script as well.
The text was updated successfully, but these errors were encountered:
constsocket=io("https://example.com",{transports: ["websocket","polling"]// use WebSocket first, if available});socket.on("connect_error",()=>{// revert to classic upgradesocket.io.opts.transports=["polling","websocket"];});
Describe the bug
I'm trying to connect with
websocket
transport first and if it fails I was hoping socketio would switch to long-polling. But for some reason, it keeps reconnecting withwebsocket
transport and never switches to polling.To Reproduce
Socket.IO server version:
4.7.2
Server
Socket.IO client version:
4.7.2
Client
Expected behavior
Was expecting the transport would switch to long-polling when websocket isn't available.
Platform:
Additional context
I disabled websocket by blocking websocket calls using the Firefox request blocking feature. Can be disabled using this TamperMonkey script as well.
The text was updated successfully, but these errors were encountered: