Why can I not connect to a real server when localhost works?

I am developing a chat function for a Titanium mobile app using node.js, now,js and I am following this

    https://gist.github.com/2782536 

, which works fine when I run node on my machine but failed after delaying node to remote node server(I tried AWS, heroku and nodejitsu).

I can establish the connection by now.initialise() from phone, now = nowjs.nowInitialize('//127.0.0.1:8080',{}); but it will fail connecting to a real server.

eg. if I change 127.0.0.1 to http://strong-stream-4567.herokuapp.com/ now.initialise() would fail.

But the weird thing is I am also serving a webpage running nowjs, which you can try http://strong-stream-4567.herokuapp.com/ , for testing, and that part always works. But I just cannot connect from phone. I also tried nodejitsu and AWS and the same thing happened. Webpage works but not the mobile client, which only works with localhost. But for AWS, I can connect the server using var nowjs = require('../../lib/nodeclient/now.js');

I am wondering what has changed from localhost to a real server..