1

I am using mean.io v 0.4.0 and trying to setup socket.io with it. I want to socket.io to listen to the nodejs server. There is a post talking about it's setup here but it doesn't fully solve my problem.
socket.io needs nodejs server object to listen to it like this. io.listen(server)
mean.io doesn't provide server object atleast I couldn't find it.

I tried to io.listen(httpServer) in mean.js and then in my socket-controller.js I would simply do

io.Socket.on('connection', function(socket){
        socket.emit('message', {'message': 'hello world'});
    });

But it didn't works out. My browser keeps on waiting whenever I hit the server.

Community
  • 1
  • 1
Mady
  • 5,016
  • 7
  • 35
  • 46

2 Answers2

0

Have you looked into the new package mean.io has come up with socket.io integration? http://mean.io/#!/packages/53e78860fc8c929e0d0a3cc7. This will help you integrate socket.io with mean.io easily.

Vivek Gounder
  • 376
  • 3
  • 9
  • I see that that exists, but I can't seem to make anything of it. Could you provide some more insight? – CamHart Feb 06 '15 at 22:28
0

Install it using mean install socket When installed you should see a page inside with documentation of how to tests it. Good luck

Lior Kesos
  • 294
  • 1
  • 5