Is there a default timeout in Node.js for http.request?

前端 未结 3 1400
后悔当初
后悔当初 2021-02-19 02:08

In Node.js there is a default timeout for a server (for an incoming HTTP request) at 120000ms (2 minutes) (see HTTP\'s server.timeout documentation).

Bu

3条回答
  •  遇见更好的自我
    2021-02-19 03:02

    No. There is no default timeout.

    Node.js uses Socket under the hood of http request and socket does not have the timeout by default.

    Use the {timeout: XX} parameter of http.request to configure a proper request timeout.

提交回复
热议问题