我做了一个简单的node.js服务器:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(9999, '0.0.0.0');
console.log('Server running at post 9999');
它可以输出:
Server running at port 9999
但是我无法通过代码所在的VPS / VDS IP 到达它:http://185.221.154.249:9999/ 为什么?
代码位于我的VDS(centos 7)内的哪个位置有关系吗?
注意:我的域与该IP绑定,并且在443号帖子中运作良好:https://webscraping.pro/(有WP博客)