diff --git a/index.js b/index.js index ade3fcc..6fac824 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ const fetch = require('node-fetch'); const fs = require('graceful-fs'); const xmlFormatter = require('xml-formatter'); -const HttpsProxyAgent = require('http-proxy-agent'); +const HttpProxyAgent = require('http-proxy-agent'); const utils = require('./lib/utils.js'); const config = require('./conf/conf.json'); @@ -75,11 +75,9 @@ } }; if (config.proxy !== '') { - fetchOpts.agent = new HttpsProxyAgent(config.proxy); + fetchOpts.agent = new HttpProxyAgent(config.proxy); } - return fetch(target, { - fetchOpts - }).then((res) => res.json()).then(async function (res) { + return fetch(target, fetchOpts).then((res) => res.json()).then(async function (res) { const nextCursorMark = res.nextCursorMark; const docs = res.response.docs; const totalResult = parseInt(res.response.numFound);