I am using 'request' node.js module (https://github.com/request/request) to send requests to another service. And sometimes it is needed to send request and wait for the response infinitely, because of the slowness of this service to which the request was sent.
It is possible to set 'timeout' property to the request and by this way you will override the default value for read and connection timeout:
timeout - Integer containing the number of milliseconds to wait for a server to send response headers (and start the response body) before aborting the request. Note that if the underlying TCP connection cannot be established, the OS-wide TCP connection timeout will overrule the timeout option (the default in Linux can be anywhere from 20-120 seconds).
But what value we can set to make this timeout infinite?