I have an Amazon EC2 instance, Ubuntu. Here's my node example:
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('Hello Express');
});
app.listen(8080, 'http://ec2-xx-xx-xx-xx.us-west-x.compute.amazonaws.com');
The xx's are my actual address.
I start node in SSH, all is well.
I go to a browser on my laptop visit http://ec2-xx-xx-xx-xx.us-west-x.compute.amazonaws.com Node errors out (visiting same domain:8080 errors out too):
events.js:72
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer [as oncomplete] (dns.js:124:16)
I do have an inbound rule for HTTP on 80 setup on this instance.
app.listen(8080);http://ec2-xx-xx-xx-xx.us-west-x.compute.amazonaws.com:8080?