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

(How) is no_proxy supported? #700

Closed
JasonBarnabe opened this issue Jun 9, 2017 · 4 comments
Closed

(How) is no_proxy supported? #700

JasonBarnabe opened this issue Jun 9, 2017 · 4 comments

Comments

@JasonBarnabe
Copy link

Version 0.12.0 in the release notes says "Proxy feature now relies on Ruby URI::Generic#find_proxy and can use no_proxy ENV variable (not compatible with ruby < 2.0)". Great! However I noticed this line:

warn 'no_proxy is unsupported' if ENV['no_proxy'] || ENV['NO_PROXY']

So is no_proxy supported or not? Or maybe supported sometimes? Please fix or document this.

@iMacTia
Copy link
Member

iMacTia commented Jun 9, 2017

Hi @JasonBarnabe,

I'm sorry about the confusion. If you check when that method is actually called, you'll see that function can only be reached if URI.parse("").respond_to?(:find_proxy) is not true (so Ruby < 2.0) or if you don't provide the url when you initialise Faraday (in which case we can't guess it for you).

So release notes don't go too much into details but simply say things as they are: we support the no_proxy automatically, but only starting from Ruby 2.0 😄

@iMacTia iMacTia closed this as completed Jun 9, 2017
@JasonBarnabe
Copy link
Author

OK, thanks for the info. I did see URI.parse("").respond_to?(:find_proxy) and was wondering what that could possibly mean :)

@iMacTia
Copy link
Member

iMacTia commented Jun 9, 2017

Oh I see. Simply the method find_proxy was introduced in Ruby 2.0 so if it's not there means we're in Ruby <=1.9 😃
We preferred to check this way instead than checking the ruby version because this way it might work also for other ruby interpreters (e.g. JRuby) if they support this function, or because you can monkey-patch older versions to support it if you need

@pboling
Copy link

pboling commented Nov 2, 2017

Using faraday 0.12.2, I am getting this output on Ruby 2.3.3 & 2.4.2 currently. Is this a regression?

When running my build on CircleCI's 2.3.3, or 2.4.2 docker image, I see this:

no_proxy is unsupported

UPDATE: Seems I am experiencing #701 which has been fixed, and there is a new release of faraday. Until @intridea loosens the faraday version constraint in oauth2 (please thumb!) we will be forking oauth2, or dealing with old faraday.

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