Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Update packages to fix upstream error
Browse files Browse the repository at this point in the history
  • Loading branch information
mnmkng committed Apr 24, 2020
1 parent 6b363d8 commit f9a0fce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apify/http-request",
"version": "1.1.5",
"version": "1.2.0",
"description": "Wrapper of got package used across Apify",
"main": "src/index.js",
"repository": "https://github.com/apifytech/http-request",
Expand Down Expand Up @@ -35,8 +35,9 @@
"sinon": "^9.0.1"
},
"dependencies": {
"apify-shared": "^0.2.10",
"apify-shared": "^0.2.11",
"got": "^9.6.0",
"proxy-agent": "^3.1.1"
"http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0"
}
}
11 changes: 5 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const got = require('got');
const ProxyAgent = require('proxy-agent');
const HttpProxyAgent = require('http-proxy-agent');
const HttpsProxyAgent = require('https-proxy-agent');

const { PassThrough } = require('stream');
const { readStreamToString } = require('apify-shared/streams_utilities');
Expand Down Expand Up @@ -122,12 +123,10 @@ module.exports = async (options) => {
}

if (proxyUrl) {
const agent = new ProxyAgent(proxyUrl);
const http = new HttpProxyAgent(proxyUrl);
const https = new HttpsProxyAgent(proxyUrl);

requestOptions.agent = {
https: agent,
http: agent,
};
requestOptions.agent = { http, https };
}

if (json) {
Expand Down

0 comments on commit f9a0fce

Please sign in to comment.