无法使用 IP 地址访问 WebStorm 内部服务器 [英] Unable to access WebStorm internal server using IP address

查看:61
本文介绍了无法使用 IP 地址访问 WebStorm 内部服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 PC 上安装了 WebStorm 并启动了 NodeJS 服务器.我可以使用 localhost 从 Chrome 和 Firefox 浏览器访问它,但不能使用我电脑的 IP 地址.

I installed WebStorm on my PC and started NodeJS server. I am able to access it from Chrome and Firefox browsers using localhost but not with my PC's IP address.

我遵循了此处.我验证了 Chrome 中是否启用了扩展,并检查了 WebStorm 的 Build, Execution, Deployment -> 中的端口号.调试器.我的 PC 的防火墙已关闭.我仍然无法使用 IP 地址访问它.

I followed instructions given here. I verified whether extension is enabled or not in Chrome as well checked the port no in WebStorm's Build, Execution, Deployment -> Debugger. My PC's firewall has been turned off. Still I am unable to access it using IP address.

谁能指导我如何去做?

我在我的 PC 上运行 WebStorm 并尝试通过上述浏览器从同一台机器访问它.

I am running WebStorm in my PC and trying to access it from the same machine through above browsers.

使用 WebStorm 2016.3.3 版本.

Using WebStorm 2016.3.3 version.

推荐答案

以下是我使用以下方法通过 Chrome 连接到 WebStorm 的内部 Web 服务器时的发现:

Here are my findings when connecting to WebStorm's internal web server via Chrome using the following:

  • WebStorm 2018.1 版本 #WS-181.4203.535
  • Windows 7 6.1,64 位专业版
  • Chrome 版本 65.0.3325.162(官方版本)(64 位)

Chrome 连接到 localhost:63342 但在尝试连接到位于 <机器的 IP 地址>:63342 的 WebStorm 时返回连接被拒绝,即使禁用了 Windows 防火墙.

Chrome connected to localhost:63342 but returned connection refused when attempting to connect to WebStorm at <ip address of machine>:63342, even with Windows Firewall disabled.

我首先将 WebStorm 配置为侦听端口 63343 而不是 63342,但结果仍然相同.出乎意料的是,使用此设置 WebStorm 在 localhost:63342 和 localhost:63343 上都回答,即使在重新启动 WebStorm 之后也是如此.

I first configured WebStorm to listen at port 63343 instead of 63342 and still had the same result. Unexpectedly, with this setting WebStorm answered at both localhost:63342 and localhost:63343, even after restarting WebStorm.

然后我注意到,对于这些端口中的任何一个,WebStorm 的可以接受外部连接复选框变灰且未选中.仅将 WebStorm 的端口更改为 1338 仍会导致 连接被拒绝,位于 http://<机器的 ip 地址>:1338.关闭 Windows 防火墙对此没有影响.

I then noticed that with either of these ports, WebStorm's Can accept external connections checkbox was grayed out and unchecked. Changing WebStorm's port to 1338 alone still resulted in Connection refused at http://<ip address of machine>:1338. Turning off Windows firewall did not affect this.

由于 WebStorm 的 可以接受外部连接 复选框在我将其端口更改为 1338 后变得可用,因此我现在选中了该复选框.Chrome 现在可以通过 http://<机器的 ip 地址>:1338 访问 WebStorm.

Since WebStorm's Can accept external connections checkbox became usable after I changed its port to 1338, I now checked the box. Chrome was now able to reach WebStorm at http://<ip address of machine>:1338.

所以看起来端口本身并不重要,而是WebStorm的可以接受外部连接复选框.请注意,如果您使用共享网络,则选中此框可能存在安全风险,因为 WebStorm 现在将向其他站点以及您自己的站点提供页面.

So it seems that it is not the port itself that makes a difference, but WebStorm's Can accept external connections checkbox. Note that checking this box may be a security risk if you are using a shared network since WebStorm will now serve pages to other stations as well as your own.

这篇关于无法使用 IP 地址访问 WebStorm 内部服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆