node.js 8080 port isn't listening

I'm following the node.js tutorial in here,

http://net.tutsplus.com/tutorials/javascript-ajax/learning-serverside-javascript-with-node-js/

this is the code,

var sys = require("sys"),  
http = require("http");  

 http.createServer(function(request, response) {  
response.sendHeader(200, {"Content-Type": "text/html"});  
response.write("Hello World!");  
response.close();  
 }).listen(8080);  

 sys.puts("Server running at http://localhost:8080/");  

in here, it says run like this url,

server's ip:8080/

but if i do this,

it just shows, cannot connect to this url.

i opened 8080 port in the server.

===========================

I'm assuming something is screwed up with codeigniter url helper...

The tutorial may be using an incorrect or deprecated method. Replace

response.sendHeader(200, {"Content-Type": "text/html"}); 

with

response.writeHead(200, {"Content-Type": "text/html"}); 

and

response.close();

with

response.end();

I Agree with the answer of Third .... make those changes and if it is local use this URL

http://127.0.0.1:8080/

But

If you are running your server not on localmachine but on something like webserver(AWS), You have to let the security of AWS firewall to allow the port to be public on the internet and also remember to use the AWS instance URL

http://AWSinstanceURL:portno/