-
Notifications
You must be signed in to change notification settings - Fork 35
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this @Janlaywss
I forgot about tests when I clicked approve. This should fix things. You'll also need to diff --git a/test/agent.js b/test/agent.js
index 0b721d7..f8def79 100644
--- a/test/agent.js
+++ b/test/agent.js
@@ -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') },
}) |
Ok, thanks a lot. I'll fix it |
The test case has been modified. After modification, my local |
Thanks, this should go out w/ the next npm cli release. |
What
Bug: SocksProxyAgent is not a constructor
In the documentation and code of
socks-proxy-agent
7.0.0, theSocksProxyAgent
class is no longer exported by default.So when we use the default export, the error
SocksProxyAgent is not a constructor
will be thrown