socket.io within express.js or vise versa

1

How do I put the sockets inside an express post?

I need to identify a connect from the express session

app.post('/login',function(req,res){

io.sockets.on('connection', function(socket){ 

        ...............

        });     

});

This way it does not execute socke.io

    
asked by anonymous 05.05.2015 / 22:27

1 answer

0

I do not understand the problem, do you need every message "/ login" to be sent to the "connection" listener?

If this is the problem you need to start the express connection "connection" listener.

After the login post, emit an emit or use socket.io itself as the communication medium between client / server.

    
14.08.2015 / 15:48