From 7d896eae82b30d1de647dcb87fe63a2b9aa28a6b Mon Sep 17 00:00:00 2001 From: Justin Hildreth Date: Thu, 11 Jun 2015 11:36:15 -0400 Subject: [PATCH] Use core http(s) Agent instead of agentkeepalive module --- httpntlm.js | 8 ++++---- package.json | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/httpntlm.js b/httpntlm.js index dea7611..8568454 100644 --- a/httpntlm.js +++ b/httpntlm.js @@ -5,6 +5,8 @@ var url = require('url'); var httpreq = require('httpreq'); var ntlm = require('./ntlm'); var _ = require('underscore'); +var http = require('http'); +var https = require('https'); exports.method = function(method, options, callback){ if(!options.workstation) options.workstation = ''; @@ -22,11 +24,9 @@ exports.method = function(method, options, callback){ var keepaliveAgent; if(isHttps){ - var HttpsAgent = require('agentkeepalive').HttpsAgent; - keepaliveAgent = new HttpsAgent(); + keepaliveAgent = new https.Agent({keepAlive: true}); }else{ - var Agent = require('agentkeepalive'); - keepaliveAgent = new Agent(); + keepaliveAgent = new http.Agent({keepAlive: true}); } async.waterfall([ diff --git a/package.json b/package.json index d1d869c..5946880 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,6 @@ "description": "httpntlm is a Node.js library to do HTTP NTLM authentication", "version": "1.5.2", "dependencies": { - "agentkeepalive": ">=1.2.0", "async": "~0.2.9", "httpreq": ">=0.4.5", "underscore": "~1.7.0"