Skip to content

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

Merged
jpogran merged 2 commits intohashicorp:mainfrom
magnetikonline:swap-proxy-agent
May 25, 2022
Merged

Swap proxy-agent with https-proxy-agent to defeat legacy ftp package issue#43
jpogran merged 2 commits intohashicorp:mainfrom
magnetikonline:swap-proxy-agent

Conversation

@magnetikonline
Copy link
Copy Markdown
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 thread package-lock.json
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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