First of all i would like to mention that i am newbie on nodejs. I have the above challenge and i am trying to find a solution:
I would like to create a nodejs web app on an android phone with 3g, that i want to hit my web page from a browser outside the phone.
The code i have already install on my phone is :
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(3000, "127.0.0.1");
console.log('Server running at http://127.0.0.1: 3000/');
and runs ok from my phone. But of course i cannot hit the webpage from a browser outside the phone.
I would appreciate a lot any kind of help - suggestions
Edit I have change the ip to 0.0.0.0 and port 8080 and the problem occurs.
I discovered, unfortunately, that the problem is on 3g network. Every cell phone does not have a unique external ip (as pc through modem) but connects to internet through an ip of the 3g/4g provider. This approach would work easily on ipv6 protocol but ipv6 is not supported from most of phones. So the cell phone is very hard to work as web server. It can be done(teamviewer did) but it is a hard work and i do not have all the appropriate knowledge. (Thats the situation with 3g providers in greece)