开发者

Why my http server I created not working with http://myserver:port/?

开发者 https://www.devze.com 2023-03-25 12:01 出处:网络
Recently I installed node on new s开发者_开发问答erver , and create this simple program. var sys = require(\"sys\"),

Recently I installed node on new s开发者_开发问答erver , and create this simple program.

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

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

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

When I run this in browser http://newserver:8080/ version 0.4.10 not working .

http://oldserver:8080/ working .version 0.5.0 pre .

Why this happening?.


You've referred to a new and an old server, which suggests to me you're not running this from localhost. In that case, have you verified that both servers have the same firewall rules? Specifically, is port 8080 allowing external traffic on the new server?


Is someone already listening on 8080? Try telnetting to that port and see if it works.

0

精彩评论

暂无评论...
验证码 换一张
取 消