Is it possible to create chat rooms dynamically with socket.io ? All the examples I've seen so far had every room declared implicitly. I am looking to achieve something like http://tlk.io/ where you simply create a chat room by accessing a random url, and then allow users in based on certain criteria.
So as we all know Socket.io is the best solution for instant messaging app and its reliability.
WebSockets are a great fit for applications like chats or simple games. Chat sessions are usually long-lived, with the client receiving messages from other participants over a long period of time. Chat sessions are also bidirectional – clients want to send chat messages, and see chat messages from others.
Yes. socket.io has a rooms feature.
From the readme:
var io = require('socket.io').listen(80);
io.sockets.on('connection', function (socket) {
socket.join('justin bieber fans');
socket.broadcast.to('justin bieber fans').emit('new fan');
io.sockets.in('rammstein fans').emit('new non-fan');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With