node.js 8080 port isn't listening -


i'm following node.js tutorial in here,

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

this 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 @ http://localhost:8080/");   

in here, says run url,

server's ip:8080/

but if this,

it shows, cannot connect url.

i opened 8080 port in server.

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

i'm assuming screwed codeigniter url helper...

the tutorial may using 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(); 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -