openapi-generator-cli icon indicating copy to clipboard operation
openapi-generator-cli copied to clipboard

Use agent for proxy configuration

Open taras opened this issue 1 year ago • 0 comments

Motivation

HTTPS for corporate proxies doesn't work after https://github.com/OpenAPITools/openapi-generator-cli/pull/651 because it assumed that @nestjs/axios took care of correctly extracting proxy configuration from the environment variables. In reality, axios proxy setup is broken as mentioned in https://stackoverflow.com/a/53399378 and https://github.com/axios/axios/issues/2072#issuecomment-567473812.

The recommended workaround is to disable axios' proxy functionality and use a proxy agent.

Approach

Use proxy-agent to create an agent that automatically uses an appropriate proxy based on environment variables. Configure the HttpModule to use the agent.

TODO

  • [ ] Install the dependency
  • [ ] Test it to verify

taras avatar Feb 06 '24 14:02 taras