opts.protocol is undefined
emilbayes opened this issue · 2 comments
Hi!
Thank you for the excellent module. I was debugging why my proxy set using env vars (HTTP_PROXY
and friends) was not being picked up, and I saw that opts
was missing the .protocol
option. Tried reading through the net
docs but couldn't find a definitive source on what the options actually are supposed to contain. It all fails on the dependency broking out if the protocol is not set: https://github.com/Rob--W/proxy-from-env/blob/e0d07a9350568b3a0c3bb28dafd3766206961a02/index.js#L29
For now I added if (!opts.protocol) opts.protocol = opts.secureEndpoint ? 'https' : 'http'
which is feels like a hack.
Any advice? I'm happy to provide a PR but not entirely sure what's right here
This code in this repository has been moved to the proxy-agents
monorepo, so I am closing this pull request. If you feel that this issue still exists as of the latest release, feel free to open a new issue over there.