简体   繁体   English

node.js服务器端口不起作用

[英]node.js server port not working

So I am creating a simple server test on my Centos 5.x box and I am having troubles getting node.js to respond on my port: 因此,我在Centos 5.x盒子上创建了一个简单的服务器测试,并且在使node.js在端口上响应时遇到麻烦:

var http = require("http");

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

This is the standard copy/pasta test. 这是标准的复制/意大利面测试。 I had it working last night, and it has since stopped working. 我昨晚让它工作了,此后它停止了工作。 I am running this out of /home/user/nodejs and do not get any compilation errors. 我正在/ home / user / nodejs之外运行此文件,没有得到任何编译错误。 There are no other node processes running either. 也没有其他节点进程在运行。 Any ideas as to what could have happened between then and now? 关于那时到现在可能发生的事情的任何想法? Any known quirky nodejs problems that may be associated with this? 与此相关的任何已知古怪的nodejs问题?

edits: 编辑:

  • I have tested various ports 我已经测试了各种端口
  • The page simply times out 该页面只是超时

RHEL / Centos 5.8 / node v0.6.15 RHEL / Centos 5.8 /节点v0.6.15

您是否尝试关闭防火墙?

我已禁用防火墙,并且它正在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM