Hello!
Currently, I am working on a project which requires some real-time communication and I've decided to work with redis and socket.io instead of pusher.
When a user logs in to the web app, he/she gets a randomly generated socket ID which is great but it's anonymous by default.
- What I want to do is, assign each logged in user to it's socket ID so I know which user I send private notifications / messages to. Example: I want to send a message to the user John Doe only, but Jane Doe and John Smith shouldn't get that message / notification.
- Also, I'll need to send notifications / messages to a group of logged in users by role (admins for example)
According to some research, I need to share the Laravel session with NodeJS, which looks simple if I use redis but I've noticed that there's some encryption / decryption going on and something is missing in the examples.
Here are some of the links I've found:
Does anyone here know how this stuff works and maybe explain it to me in short? Some examples would be cool too.
I am using Laravel 5.1, Redis 3.0, NodeJS 5.3.0, ExpressJS 4.13.* and Socket.io v. 1.3.7 / 1.4.1
Thanks for reading!