Node red ui-control at DB2

Hi all.

I am looking for any node, that inform me about connected browsers to node-red server, like a socketId, but there is I think bug at ui-control.

I have tested it, but without result, that is described in pages flowfuse :

So, write me please, how it works ? Described examples has no real value.
My testing here is with nodes :

So at the first example, for debug 192 is only change/lost/connect status. After I have changed page, or I have created new connection from outside via ddns routing page, nothing more is displayed only status : Connect. If is debug node changed to output socketid, displays only : Undefined.

Second example is ui-event node to debug. But this node have not any socketid instance.

Please, give some feedback, if I tried anything wrong, or is there a bug ?

Bobo

Hi Felix,

This may well be a bug in the Control node, however, the “Event” node is now the default handler for this kind of thing with Dashboard 2.0, and emits pageview and pageleave events. In the “msg._client” object, you will find socketID

Hi Joe

maybe I am doing some things wrong, but :

In function :

msg.payload=msg._client.socketID;
return msg;

Doesn’t work at this moment. If you change Inject node with button with equal conditions, that is OK, and generate correct socketId.

Why Inject node has no possibility to generate loop for “socketId” ?
Is there a next bug, or no ??

If yes, I am not very satisfied with this “half” work.
There is too much articles and replies, how is DB1 deprecated, but DB2 is not correct completed.

Is the socketID same at all instances generated from one PC … I am not a professional in this, and some articles are not very friendly to explain it to details, but I think, that it must be ….

Thanks to your reply.

Bobo

Where is the msg._client.socketID coming from. The inject node does not (and as far as I am aware has never) generated that as part of a msg.

I am not an expert but I am pretty sure that that property of a msg is normally only generated by a Dashboard 2 node. Dashboard 1 only generates a socketID, no _client.

Jeff, I think so same, after your entry.

But, how can I extract socketId from running instance to check, which connection of browser coming in ? May be from ui-control or ui-event.

I will work on it. Yesterday was until late night ……

Thanks to your reply. Bobo

Wire the UI Event node as the first node in your flow. The socketID is generated from the browser event. Whenever someone views your Dashboard, the UI Event emits a “pageview” message.

Within that message will be msg._client

Your function nodes is correct, it just needs to be wired after a UI Event node. The inject node has no knowledge of the Dashboard/client socket