Closed shubham1172 closed 5 years ago
Correct, you should create a new instance for each account.
What'll be the best way to store an instance of XMPP client per user in the memory? Express-session or redis cannot save objects like these, I suppose :/
Yeah, you will need to have some sort of daemon which maintains the connection as long as you need to keep it open. You cannot store network connections like you can with normal objects as they require system resources to stay active. This is something I've been working on with github.com/sockethub/sockethub which abstracts protocol specifics, as well as maintaining state, away from web applications. It may not suit your needs, but might provide some inspiration for your use case, but I can't really provide any more suggestions without knowing more.
Hey, for an instant messaging application with multiple clients, should one create multiple instances of XMPP clients? What is the best way to deal with this use case?