you can run 2 instances of redis, one on server A and one on server B.
if you bind adresses on A to * or to 127.0.0.1,B's IP, you can ask the server B to be slave of A: slaveof <A ip adress> 6379
every publish made by A will be replicate To B , so you can listen on the B serveur to the channel and push that you want to the Room
For you information , you can start the server to test like this :
On A :
redis-server --port 6391 --bind (B-IP) --bind 127.0.0.1
on B:
redis-server --port 6392 --slaveof (A-IP) 6391
i'm not fully tested this solution(only tested on local host for the twice server) , but that should work
if you want to take care of some keys you can use psubscribe with some "keys" as channel name. i done it like that before:
on A
publish "|key1=toto||key2=titi||key3=plop|" "nanana"
on B
PSUBSCRIBE "*|key2=titi|*"
as you see separator on the key , you will have only the filtering push
you can do something like that in your node/socketIo :
on A
var redis = require("redis");
client = redis.createClient();
client.publish("room::"+roomID, message);
on B
var redis = require("redis");
client = redis.createClient();
client.on("pmessage", function (pattern,channel, message){
//emit on roomid(in channel) the message
}
client.psubscribe("room::*");
not tested...