This works perfectly on my own computers server
var socket = io.connect('http://localhost:3000');
socket.of(userid).on('email', function (data) {
console.log("here")
});
however when I switch to heroku like
var socket = io.connect('http://staginggorkemnutrition.herokuapp.com');
socket.of(userid).on('email', function (data) {
console.log("here")
});
it seems like the event is never received, also I dont change anything on my server when I am changing from heroku to localhost
ps. I have this in my server, I know I have to add this for heroku global.io.configure(function () { global.io.set("transports", ["xhr-polling"]); global.io.set("polling duration", 10); });
and my server side code when I emit the message looks like looks like:
exports.getFake = function(req, res){
global.io.of(global.id).emit('email' , email);
}