Last active
August 29, 2015 14:21
-
-
Save TomoakiNagahara/a7b0d8194c1102f0aa18 to your computer and use it in GitHub Desktop.
Socket.IO を PM2 でロードバランシングしたい ref: http://qiita.com/TomoakiNagahara/items/08e327e54a6f66c3fa38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var server = app.listen(3000, function() { | |
}); | |
// 0.9系のsocket.io | |
var io = require('socket.io').listen(server); | |
// 0.9系のredis | |
var redis = require('socket.io/lib/stores/redis'); | |
var redisConf = { host: '127.0.0.1', port: 6379 }; | |
// storeタイプをredisに変更 | |
io.set('store', new redis({ | |
redisPub: redisConf, | |
redisSub: redisConf, | |
redisClient: redisConf | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment