I finally got around to trying this again and am still having issues. Here's two configs I tried:
sioRedisStore = new RedisStore()
initSocketIO = (io) ->
io.configure(->
io.set('store', sioRedisStore) # config1
# io.set('store', new RedisStore()) # config2
)
io.sockets.on('connection', (client) ->
console.log "SOCKETIO connection"
client.on("message", (message, callback) ->
console.log "SOCKETIO message"
)
client.on("disconnect", ->
console.log "SOCKETIO disconnect"
)
client.on("close", ->
console.log "SOCKETIO close"
)
)
httpIO = socketio.listen(httpServer)
initSocketIO(httpIO)
httpsIO = socketio.listen(httpsServer)
initSocketIO(httpsIO)
In the first config where there is a shared redisstore between the two http and https socketio instances, everything works fine except for rooms seem to be separate. That is if a client from http joins the same room a client from https does, they will not broadcast messages to each other. http -> http and https -> https works fine.
In the second config where each socketio instance has its own redisstore, for some reason a disconnect and close immediately fires after connection (in the logs I will see SOCKETIO connection immediately followed by SOCKETIO disconnect and SOCKETIO close) and the messages handler never fires for either socketio instance.
It seems like the first config is closer to being correct but can't seem to figure out how what I am doing wrong. Any suggestions would be greatly appreciated. Thanks!