Support for HTTP proxy
Q&A (please complete the following information)
- CLI version: 0.2.8
- OS: macOS 10.15.5
- Node.js version: v12.18.0
Describe the bug you're encountering
Cannot connect to api.swaggerhub.com behind corporate HTTP proxy.
To reproduce...
Steps to reproduce the behavior:
$ swaggerhub api:get my-org/my-api/0.1
› Error: request to https://api.swaggerhub.com/apis/my-org/my-api/0.1 failed, reason: connect ETIMEDOUT
› 18.214.171.198:443
Expected behavior
CLI should use standard environment variables http_proxy,https_proxy.
Screenshots
Additional context or thoughts
@erhhung Thanks for the idea here. This is something we'll look into supporting as I think it could be common.
Are you frequently setting http_proxy or https_proxy for other code or scripts you're using? If so, would you be able to share any that are open source that follow this pattern? Thanks!
Are you frequently setting
http_proxyorhttps_proxyfor other code or scripts you're using? If so, would you be able to share any that are open source that follow this pattern? Thanks!
I don't set these frequently but I know for certain that these are the de facto variables in UNIX environments. In addition to http_proxy or https_proxy (http://user:pass@host:port), you should also honor no_proxy (domain name suffix, IP prefix and CIDR formats). I'd for sure use a common library instead of reinventing the wheel.
can confirm, we're also blocked here because swaggerhub-cli doesn't implement setting and using proxy values in the rc file or pull the variables from the env from which the shell is being run.