From 95672c984103126377708c6981e9f305c1610218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Vicente=20Sogorb=20Moro=CC=81n?= Date: Wed, 2 May 2018 11:16:30 +0200 Subject: [PATCH] Add support for a custom request timeout option --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 8b522ff..55683f8 100644 --- a/index.js +++ b/index.js @@ -221,7 +221,7 @@ var ProxyVerifier = module.exports = { } try { - var ipAddress = options.ipAddressCheckFn(data, status, headers); + var ipAddress = options.ipAddressCheckFn(data, status, headers); } catch (error) { return cb(error); } @@ -417,6 +417,7 @@ var ProxyVerifier = module.exports = { }); req.on('error', done); + req.on('timeout', req.abort); req.end(); return req;