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




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


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/
    at Manager.handleClient (/var/www/node_modules/
    at Manager.handleHTTPRequest (/var/www/node_modules/
    at Manager.handleRequest (/var/www/node_modules/
    at HTTPServer. (/var/www/node_modules/
    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

使用声明 | 英豪名录