Scaling Socket.IO and broadcast to all belonging clients

I’m using

Express with "connect-redis" session store

And I tied it with Socket.IO through configuring “authorization”

So that I don’t have to actually use

socket.get

Or

socket.set

To store and retrieve a client’s belonging variables.

But I’m not sure that If I broadcast a message to specific group of people, connected in different server, get message successfully.

So that it is truly scaled!

But It seems to be not truly scaled
but only use Redis as storing values individually.

Also I tried to use

RedisStore

which is given by Socket.IO

does not work.

It is saying

DEBUG: TypeError: Converting circular structure to JSON
    at Redis.stringify [as pack] (native)
    at Redis.publish (/var/www/node_modules/socket.io/lib/stores/redis.js:106:31)
    at Manager.handleClient (/var/www/node_modules/socket.io/lib/manager.js:646:18)
    at Manager.handleHTTPRequest (/var/www/node_modules/socket.io/lib/manager.js:595:8)
    at Manager.handleRequest (/var/www/node_modules/socket.io/lib/manager.js:557:12)
    at HTTPServer. (/var/www/node_modules/socket.io/lib/manager.js:112:10)
    at HTTPServer.emit (events.js:70:17)
    at HTTPParser.onIncoming (http.js:1507:12)
    at HTTPParser.onHeadersComplete (http.js:102:31)
    at Socket.ondata (http.js:1403:22)

How can I scale Socket.IO with broadcasting to all scaled clients available?

Edit:I followed the Express-Session-Socket.IO tutorial
and I have found that io.authorization actually makes problem but it is okay
without io.authorization
. How is that?

Problem courtesy of: InspiredJW

Node.js Recipes责编内容来自:Node.js Recipes (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » Scaling Socket.IO and broadcast to all belonging clients

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录