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

Swap proxy-agent with https-proxy-agent to defeat legacy ftp package issue #43

Merged
merged 2 commits into from
May 25, 2022
Merged

Swap proxy-agent with https-proxy-agent to defeat legacy ftp package issue #43

merged 2 commits into from
May 25, 2022

Conversation

magnetikonline
Copy link
Contributor

A fix for #42 - where the ftp package is causing the following warning when this package is used:

(node:1617) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Some investigation/further digging - the existing proxy-agent package simply wraps a number of packages for HTTP proxies, socks proxies/pac/etc. - but all we really need/want is HTTPS_PROXY support.

Thus, we can swap this out for the child https-proxy-agent package - and avoid bringing along all the cruft of additional packages we don't need - and in that, the offending ftp package. 🎉.

Have tested locally using Proxyman and HTTPS_PROXY="http://127.0.0.1:9090" - can see successful requests being made via Proxyman as the proxy.

Comment on lines -546 to -554
"ftp": {
"version": "0.3.10",
"resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz",
"integrity": "sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0=",
"requires": {
"readable-stream": "1.1.x",
"xregexp": "2.0.0"
}
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted, offending ftp package now gone.

@magnetikonline
Copy link
Contributor Author

(Gentle) bump @jpogran - a fix for #42

@jpogran jpogran added this to the 1.6.0 milestone May 13, 2022
@jpogran jpogran self-assigned this May 13, 2022
@jpogran jpogran added the enhancement New feature or request label May 13, 2022
@magnetikonline
Copy link
Contributor Author

Thanks @jpogran 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants