Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TypeError: SocksProxyAgent is not a constructor #161

Merged
merged 3 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/agent.js
Original file line number Diff line number Diff line change
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')
wraithgar marked this conversation as resolved.
Show resolved Hide resolved
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
Original file line number Diff line number Diff line change
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