TooTallNate / node-proxy-agent

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

Set the protocol of the Agent #72

Closed carlitose closed 1 year ago

carlitose commented 2 years ago

It is possible to set the protocol of the agent manually? I see that on module agent-base you could set protocol.

Because the agent.protocol, returned from ProxyAgent, is always set to 'http:'

We initialize the proxy agent in this way

if (process.env.HTTPS_PROXY) {
  https.globalAgent = new ProxyAgent(process.env.HTTPS_PROXY);
  console.log(https.globalAgent?.protocol); // always http:
}

thx

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.