Timeout HTTP/HTTPS requests
Emit Error object with
code property equal
ESOCKETTIMEDOUT when ClientRequest is hanged.
var get = get;var timeout = ;var req = ;; // Set 2 seconds limit
The request to watch on.
Time in milliseconds to wait for
connect event on socket and also time to wait on inactive socket.
Or you can pass Object with following fields:
connect- time to wait for connection
socket- time to wait for activity on socket
MIT © Vsevolod Strukchinsky