简体   繁体   English

Node.js浏览器响应:连接超时

[英]Node.js browser response : Connection time out

I wrote a simple web-server progam that runs on my server at xxxx 我编写了一个简单的Web服务器程序,该程序在服务器上的xxxx上运行

When I test it locally: curl http://localhost:port 当我在本地测试时: curl http://localhost:port

It runs ok, but when I use web browser http://xxxx:port 它运行正常,但是当我使用Web浏览器http://xxxx:port

The browser response: Connnection time out. 浏览器响应:连接超时。

Hope you have included response.end() in the server response. 希望您在服务器响应中包含了response.end()。 This signals to the web browser that no further data should be expected and the view is rendered. 这向Web浏览器发出信号,表明不应再有其他数据,并且将渲染视图。 Else it would continue to wait for data and would eventually time out. 否则它将继续等待数据,并最终超时。 Refer the Node docs for a reference to this requirement. 有关此要求的参考,请参考Node文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM