socket.io inside express.js or vise versa

Asked

Viewed 52 times

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){ 

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

        });     

});

That way he doesn’t execute socke.io

1 answer

0

I didn’t quite understand the problem, you need that every post "/login" be sent a message to the "Connection" System" ?

If this is the problem you need to start the Express-independent "Connection" System.

After the login post an Emit or use the socket.io itself as a means of communication between client/server.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.