ntwitter and Heroku doesn't act as in local

I've got this very simple app that use ntwitter and socket.io. It is a birdge for an other app. I put it on Heroku and it has work for few hours. The log does't show anything and the app is running well. So basically it is quiet a mistery.

Please find the app here :

https://github.com/soixantecircuits/whos-knocking-node/

In local there is no issue at all.

Using foreman start works perfectly in local.

I'm lost and would much enjoy your help.

For those of you that would have time to check out the github repo, please find the code bellow :

var twitter = require('ntwitter');
try {
    var credentials = require('./credentials.js');
} catch (err) {
    console.log("Error:", err);
    console.log("Using environmental credentials.");
    var credentials = {
        consumer_key: process.env.CONSUMER_KEY,
        consumer_secret: process.env.CONSUMER_SECRET,
        access_token_key: process.env.ACCESS_TOKEN_KEY,
        access_token_secret: process.env.ACCESS_TOKEN_SECRET
    };
}    

var app = require('express')(),
    server = require('http').createServer(app),
    io = require('socket.io').listen(server);    

var port = process.env.PORT || 5000;
var nTwitterCount = 0;    

server.listen(port);    

app.get('/', function(req, res) {
    //res.sendfile(__dirname + '/index.html');
    res.writeHead(200, {
        'Content-Type': 'text/plain'
    });
    res.end('Ring the Bell\n' + nTwitterCount);
});    


var new_tweet = {};    

var t = new twitter({
    consumer_key: credentials.consumer_key,
    consumer_secret: credentials.consumer_secret,
    access_token_key: credentials.access_token_key,
    access_token_secret: credentials.access_token_secret
});
t.stream('statuses/filter', {
    track: ['soixantecircuits', 'ringthebell']
}, function(stream) {
    stream.on('data', function(tweet) {
        //console.log(tweet.text);
        nTwitterCount++;
        //new_tweet = tweet.text;
        console.log(tweet);
        io.sockets.emit('new_tweet', tweet);
    });
    stream.on('error', function(response) {
        console.log(response);
    });
    stream.on('end', function(response) {
        console.log(response);
    });
    stream.on('destroy', function(response) {
        console.log(response);
    });
});

Thanks for any help.

My hunch is that since you're using Socket.io, you want to use Websockets. Heroku does not support Websockets yet. You'll havet to force using long-polling with Socket.io on Heroku.

See this: https://devcenter.heroku.com/articles/using-socket-io-with-node-js-on-heroku

In short, do this:

io.configure(function () { 
 io.set("transports", ["xhr-polling"]); 
 io.set("polling duration", 10); 
});

Again, this is just my hunch. Try it and let me know.