TooTallNate / node-proxy-agent

Maps proxy protocols to `http.Agent` implementations
285 stars 69 forks source link

opts.protocol is undefined #49

Closed emilbayes closed 1 year ago

emilbayes commented 4 years ago

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

emilbayes commented 4 years ago

Ah, overlooked this related PR: https://github.com/TooTallNate/node-proxy-agent/pull/39

TooTallNate commented 1 year ago

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.