Skip to content

Commit

Permalink
fix(proxy): revert previous proxy solution
Browse files Browse the repository at this point in the history
This reverts commit 1a714e7.
  • Loading branch information
zkat committed May 24, 2017
1 parent 2583790 commit 563b0d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function getAgent (uri, opts) {
}

if (pxuri) {
const proxy = getProxy(pxuri, parsedUri, opts)
const proxy = getProxy(pxuri, opts)
AGENT_CACHE.set(key, proxy)
return proxy
}
Expand Down Expand Up @@ -120,7 +120,7 @@ function getProxyUri (uri, opts) {
let HttpProxyAgent
let HttpsProxyAgent
let SocksProxyAgent
function getProxy (proxyUrl, destUrl, opts) {
function getProxy (proxyUrl, opts) {
let popts = {
host: proxyUrl.hostname,
port: proxyUrl.port,
Expand All @@ -134,14 +134,14 @@ function getProxy (proxyUrl, destUrl, opts) {
rejectUnauthorized: opts.strictSSL
}

if (destUrl.protocol === 'http:') {
if (proxyUrl.protocol === 'http:') {
if (!HttpProxyAgent) {
HttpProxyAgent = require('http-proxy-agent')
}

return new HttpProxyAgent(popts)
}
if (destUrl.protocol === 'https:') {
if (proxyUrl.protocol === 'https:') {
if (!HttpsProxyAgent) {
HttpsProxyAgent = require('https-proxy-agent')
}
Expand Down

0 comments on commit 563b0d8

Please sign in to comment.