简体   繁体   English

从本地网络上的远程计算机访问NodeJS服务器显示空白页

[英]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所示)。

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.

相关问题 NodeJS将文件从本地计算机上传到远程服务器 - NodeJS upload file from local machine to remote server 在本地网络上的差异计算机上访问客户端和服务器应用 - Accessing client and server app on diff machine on local network 将文件从NodeJS Server下载到本地计算机 - Download file from NodeJS Server to local machine 使用nodejs将http请求从远程服务器重定向到本地服务器 - Redirect an http request from a remote server to a local server using nodejs Nodejs内置调试器显示空白页面 - Nodejs built-in debugger shows blank page Kubernetes 入口:NodeJS 应用程序显示空白页 - Kubernetes Ingress: NodeJS application shows blank page npm run build 在本地机器上运行良好,但在远程 ubuntu 服务器上显示错误 - npm run build works fine on local machine but shows error on remote ubuntu server nginx Ubuntu nodeJs-服务器仅处理来自本地网络的请求 - nginx Ubuntu nodeJs - Server only handles requests from local network 使用静态地址访问远程计算机上的sqlite数据库(Electron / Nodejs / fs) - Accessing sqlite databases on remote machine with static adress (Electron / Nodejs / fs) 在 NodeJS 服务器上获取本地网络 ip 地址 - Get local network ip addresses on NodeJS server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM