Node-red dashboard socket.io transports change

hi guys
my dashboard appears connection lost blink.

I pressed F12 on chrome
when lost connection I saw [transport=polling] messages and [upgrade=websocket]
so i want to change websocket way.

socket.io verson 2.4

socket.io documentation do this code " const socket = io ({ transports: ['websocket']}); "

but i don't know where it change
socket.js? manager.js?

please help me.

You really do not want to do that.

Even a raw websocket connection uses http first and then "upgrades" to ws. Socket.IO is a lot smarter and will typically start with the http request, and use polling until the upgrade happens where it switches. So you are not waiting for the ws server to upgrade your connection.

Socket.Io does all the clever things for you and you don't want to mess with it when it is working as expected.

In any case, this is all embedded into Dashboard and Node-RED so messing is not really an option.

thank you.
I want to solve dashboard connection lost.

I think sever is not response well and quickly.
so dashboard lost connection

my node-red code has long process time because of o(n).
I can't handle it

I try to disable auto tab discard on chrome.
but it failed

do you have any solution?

/* dashboard version 2.30
/* node-red version 1.3.5
/* nodejs 14.x

I don't use dashboard much.

However, check on your server to see how loaded it is.

What OS is your server? What hardware? What else is running on it?

If the server is on a Pi, are you running a Linux desktop on the same device? Worse still, are you using that desktop to access Dashboard? If so, ditch the desktop completely if you can, it is a real drain on resources. Access from a different device.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.