Session 4 - Multiple servers and Socket.IO

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Right the first thing that came up to my mind when I read the title of the thread in the forums: "Seems like someone had made something about that socketIO stuff, but for real! I wonder how do they solve the issue about one or another server?"
I checked the thread as I wanted to make some MMO-esque game, I didn't expect you'd actually have this much!

REALmyenemy
Автор

Will it work same on multiple ec2 instances behild ALB?

tesla
Автор

When I try to run socket.io on two server using AWS Load balaancer I am getting this error any solution of this..

But everything working fine if I run on single server.

thanks in adavance

Error: failed: WebSocket is closed before the connection is established.

Code Sample on server side

var server = app.listen("80");
var io =

// redis enable
var redis = require('socket.io-redis');
io.adapter(redis({host: 'xxx.redis host url ', port: 6379}));

Do I need to add anything more in it for running on two server

And If i try to connect to Aws redis cluster how can i do it in above code

You used Single server with sticky session can help in above error...
DO I also have to add it

pawannagar