Twitter Stream & Node js server Error

I am trying to connect connect to twitter streaming api and I am getting the error

events.js:87
      throw er; // Unhandled 'error' event
            ^
Error: Bad Twitter streaming request: 401
    at ClientRequest.<anonymous> (/home/vikas/t4d/node_modules/twit/lib/oarequest.js:202:19)
    at ClientRequest.g (events.js:201:16)
    at ClientRequest.emit (events.js:109:17)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:421:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:113:23)
    at TLSSocket.socketOnData (_http_client.js:312:20)
    at TLSSocket.emit (events.js:109:17)
    at readableAddChunk (_stream_readable.js:164:16)
    at TLSSocket.Readable.push (_stream_readable.js:128:10)
    at TCP.onread (net.js:540:20)

THe official api says it as Unauthorized access, but I am sure I have the right credentials (I have tested them before).

Also my www file has the entry

nconf.defaults({
  'PORT': process.env.OPENSHIFT_NODEJS_PORT || process.env.PORT || 3000,
  'BIND_IP': process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1'
});

where putting 127.0.0.1 is also fine. I don't understand why I am getting the error and how to remove it ?

I am using the code for connecting from here. I have all the dependencies installed.

Thanks a lot for your help.