最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Centos 7 Linux节点:Telnet工作但无法使浏览器连接

运维笔记admin11浏览0评论

Centos 7 Linux节点:Telnet工作但无法使浏览器连接

Centos 7 Linux节点:Telnet工作但无法使浏览器连接

我在防火墙上打开了一个端口并取得了成功

firewall-cmd --zone=public --add-port=777/udp --permanent

...

然后我使用一个简单的节点createServer

http.createServer(function (req, res) {
  res.write('Hello World!!!'); //write a response to the client
  console.log(req.url);
  res.end(); //end the response
}).listen(777); //the server object listens on port 777

...

当我尝试Telnet时,我得到一个连接

telnet <myip> 777 // this shows that there is a connection...

但是当浏览器中的IP浏览器,即<my.ip.address:777>,我得到连接拒绝...

在我的本地电脑中这可以正常工作......

有谁知道可能是什么问题?

回答如下:

您可以在代码中指定IP,否则必须在localhost:777上连接

如果这是在任何虚拟机上,您只需使用本地端口转发

ssh -L <any port>:localhost:777 root@ip

然后在localhost:anyport上连接您的浏览器

发布评论

评论列表(0)

  1. 暂无评论