I am aware that NodeRed's Dashboard does NOT support multiple individual users. However, in my flow I use a template node which serves a hypertext game in html. The flow sends and receives various payloads from/to the game through a WebSocket node. My work is based on this project if you are curious: GitHub - davemee/TwineNodered: Pieces to feed data into Twine2 from Node-Red, as well as serve games from a Node-Red server.
Getting to the point, my question is, can multiple users access and navigate through the served HTML individually but at the same time while running a single instance of NodeRed? My project is not finished, so I have no way of testing multiplee users, but just want to know if possible, or if I need to run separate instances of NodeRed. Thanks!
In short, yes. Though the devil is in the detail and I've not checked your link. Trick would be to ensure that the server end has no need to retain any knowledge about what happens in the browser. then all you need to do is get your messages to retain the socket id so that data is sent to the correct client.
If your game does need to know more about the client state then things get quite complex very quickly. But it is still doable - not simple though.
One thing to remember, the socket id for a specific client will change if the user reloads the page or if the socket looses connection then reconnects.
Yes you do, that's the benefit of working with web apps. You can get 2 users on a single browser just by having a main user page normally and another on an in-private window. Install a few other browsers and you can easily get 1/2 dozen or more. Even easier if you don't retain any state in the client (e.g. no cookies) since you can then simply keep creating new browser tabs. Oh, and don't forget that many modern browsers let you create multiple profiles and run them in parallel so that's even more instances. Beyond that, there are other ways such as using VM's.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.