Websockets Question

Playing around with Node and websockets to see what all the fuss is about. Websockets are pretty cool and if I ever have to redo my project I may have to go Node just for that.

My question is though, what are these and what is the difference between them (Connect and Disconnect)? They don’t seem to have any properties set yet websockets still work?

Ignore the Name one … I was just seeing what it does.

The connect and disconnect actions run anytime a client connects/disconnects from the server (if the Socket element is added to the front end page).

So for example, you could use the Socket Identify in the connect action to store the socket id of every user when they first connect with your app. Then later on, you could send a direct message to a specific user using their socket id.

2 Likes

Thanks Ken,

That is a little beyond my skill level yet :wink:

Really does open up some doors though. I like what I see just from my very limited knowledge.

Hi Ken, is there a way to display this value on the page? And a way to see it in the developer console?

I am curious as to what the value looks like.

It is the sid on Network > WS > Messages…

1 Like

Thanks Ken!

1 Like

I must be doing something wrong? In my Network -> WS -> Messages in the developer tools it seems like it is going in an endless loop. And it never does give me the sid?

Update: I think I know why it is in an endless loop. I have the websocket in my query API steps. So, of course it would just keep running itself over and over. I need to walk away and attack it again in the morning.

Baby steps, I’m learning! :wink: