Saturday 20 February 2016

Socket emit only in specific page

Hello, I have node app that is sending things to PHP based website. Here is my question, how to start to emit socket only if user is only in for example on page /profile/[regex]/groups. Because now even if user is in any place on the website node is emitting a message but he just doesn't recieve it. I want to do it using one node app working on one port.Here is how i include this node app in PHP app: var socket = io.connect('http://localhost:3000'); And this is attached to every single page in my website to I need to do it in node. Thanks :)

Submitted February 20, 2016 at 01:04PM by Gurlox

No comments:

Post a Comment