Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for HTTP proxy #122

Open
erhhung opened this issue Jul 31, 2020 · 3 comments
Open

Support for HTTP proxy #122

erhhung opened this issue Jul 31, 2020 · 3 comments

Comments

@erhhung
Copy link

erhhung commented Jul 31, 2020

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

@smizell
Copy link

smizell commented Aug 7, 2020

@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!

@erhhung
Copy link
Author

erhhung commented Sep 1, 2020

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!

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.

@zentechinc
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants