Saturday, 22 April 2017

ExpressJS and Socket.io

Hi there and thanks in advance.

Im using ExpressJS 4.0 and Socket.io 1.7

I want my clients to connect to server socket and if some API or event is fired, lets say router.post('/test') its successfull then emit a msg or data to the client that fired that event.

Can this be done?

I did req.app.io and then on my /test route req.app.io.emit(), but that fires for every client connected to the socket and not the proper one.

Thanks. Max



via mdv

No comments:

Post a Comment