器中出现服务器禁止错误"/>
在我的浏览器中出现服务器禁止错误
我刚刚开始探索node.js。已在我的 Windows 服务器上安装了 msi 文件。下面的代码返回了命令窗口中的预期输出
var http = require("http");
http.createServer(function (request, response) {
// Send the HTTP header
// HTTP Status: 200 : OK
// Content Type: text/plain
response.writeHead(200, {'Content-Type': 'text/plain'});
// Send the response body as "Hello World"
response.end('Hello World\n');
}).listen(8081);
// Console will print the message
console.log('Server running at `http://127.0.0.1:8081/`');
但是当我在浏览器中输入
http://127.0.0.1:8081/
时,我没有得到任何输出。当我看到控制台时,出现以下错误
Failed to load resource: the server responded with a status of 403 (Forbidden)
我错了什么以及如何解决?我正在关注这个链接
回答如下:可能就像我当前的电脑一样,您的电脑也必须运行 McAfee 或某些其他程序已经使用端口 8081,您有两个选择:
- 停止 McAfee 或该端口上运行的其他程序
- 监听节点服务器上的不同端口
更多推荐
在我的浏览器中出现服务器禁止错误
发布评论