h2non/rocky

Request cloning breaks HTTP agents

csabakoncz opened this issue · 0 comments

const options = _.cloneDeep(opts || req.rocky.options)

Running under node 8.9.4 and using https-proxy-agent (https://github.com/TooTallNate/node-https-proxy-agent) to get across a corporate proxy, I get this error:

Agent option must be an Agent-like object, undefined, or false.

Could fix it by restoring the agent after the deep cloning:

  //restore agent:
  options.agent = req.rocky.options.agent;