Skip to content

Commit

Permalink
fix: TypeError: SocksProxyAgent is not a constructor (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janlaywss committed Jun 20, 2022
1 parent e42eb5d commit 4ae4864
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/agent.js
Expand Up @@ -171,7 +171,7 @@ const getPath = u => u.pathname + u.search + u.hash

const HttpProxyAgent = require('http-proxy-agent')
const HttpsProxyAgent = require('https-proxy-agent')
const SocksProxyAgent = require('socks-proxy-agent')
const { SocksProxyAgent } = require('socks-proxy-agent')
module.exports.getProxy = getProxy
function getProxy (proxyUrl, opts, isHttps) {
// our current proxy agents do not support an overridden dns lookup method, so will not
Expand Down
2 changes: 1 addition & 1 deletion test/agent.js
Expand Up @@ -9,7 +9,7 @@ const agent = t.mock('../lib/agent.js', {
agentkeepalive: MockHttp,
'https-proxy-agent': mockHttpAgent('https-proxy'),
'http-proxy-agent': mockHttpAgent('http-proxy'),
'socks-proxy-agent': mockHttpAgent('socks-proxy'),
'socks-proxy-agent': { SocksProxyAgent: mockHttpAgent('socks-proxy') },
})

function mockHttpAgent (type) {
Expand Down

0 comments on commit 4ae4864

Please sign in to comment.