我建立了一个Node JS服务器,并向它发出了一个请求,它只是加载并加载并最终表示“未找到服务器”。这里是我的文件的代码:节点JS - 服务器对请求没有反应
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
当去外部IP:1337,发生上述现象。我运行Ubuntu 14.04,节点JS版本0.10.32。 关于发生了什么的任何提示? 谢谢
'向它发出了请求',你如何提出请求?!? – thefourtheye 2014-10-04 14:11:23