diff --git a/conf/conf.json b/conf/conf.json index 6cdc651..fd8d9e6 100644 --- a/conf/conf.json +++ b/conf/conf.json @@ -1,5 +1,5 @@ { - "halApi":"https://api.archives-ouvertes.fr/search?", - "proxy":"https://proxyout.inist.fr:8080", + "halApi":"http://api.archives-ouvertes.fr/search?", + "proxy":"http://proxyout.inist.fr:8080", "max_retry":2 } \ No newline at end of file diff --git a/index.js b/index.js index 9e097a2..ade3fcc 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('https-proxy-agent'); +const HttpsProxyAgent = require('http-proxy-agent'); const utils = require('./lib/utils.js'); const config = require('./conf/conf.json'); @@ -75,7 +75,7 @@ } }; if (config.proxy !== '') { - fetchOpts.headers.agent = new HttpsProxyAgent(config.proxy); + fetchOpts.agent = new HttpsProxyAgent(config.proxy); } return fetch(target, { fetchOpts diff --git a/package.json b/package.json index 47b1085..eec5aa4 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "dependencies": { "chai": "^3.4.0", "graceful-fs": "^4.2.8", + "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "mocha": "^2.3.3" },