[英]Accessing NodeJS server from remote machine on local network shows a blank page
I wanted to test my ReactJS + NodeJS website on another machine on my LAN, so I changed the server host ip from localhost
to 0.0.0.0
as described in this answer. 我想在我局域网上的另一台机器上测试我的ReactJS + NodeJS网站,因此我按照此答案中所述将服务器主机ip从
localhost
更改为0.0.0.0
。 I noticed that although I could access the server from a remote machine, all I could see was the title and favicon (the rest was a blank page). 我注意到,尽管我可以从远程计算机访问服务器,但我只能看到标题和图标(其余为空白页)。 I tried another approach of using the ngrok module as described here (which happens to be the answer to the same question as the previous link).
我尝试了使用此处描述的使用ngrok模块的另一种方法(恰好是与上一个链接相同的问题的答案)。 I still got the same blank page.
我仍然有相同的空白页。
The GET
requests to the server are shown below (as shown by ngrok). 到服务器的
GET
请求如下所示(如ngrok所示)。
/landing
is a page I was trying to access. /landing
是我尝试访问的页面。 Can someone explain whats happening? 有人可以解释发生了什么吗?
PS : The server is running on a Mac and I'm trying to access the page on an Ubuntu machine. PS :服务器正在Mac上运行,我正在尝试访问Ubuntu计算机上的页面。 Also, I'm using this react-redux boilerplate.
另外,我正在使用这个 react-redux样板。 Webpack is also being used along with hot reloading.
Webpack也与热重装一起使用。
Did you try changing port settings in firewall? 您是否尝试过更改防火墙中的端口设置?
Go to firewall settings and allow the respective port for inbound 转到防火墙设置,并允许相应的端口入站
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.