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

feat: Add http proxy option for curl client #775

Merged
merged 13 commits into from
Feb 23, 2019

Conversation

HazAT
Copy link
Member

@HazAT HazAT commented Feb 22, 2019

No description provided.

@HazAT HazAT self-assigned this Feb 22, 2019
src/Options.php Outdated Show resolved Hide resolved
src/Options.php Outdated Show resolved Hide resolved
src/ClientBuilder.php Outdated Show resolved Hide resolved
src/ClientBuilder.php Outdated Show resolved Hide resolved
@ste93cry
Copy link
Collaborator

I'm entirely 👎 on this change, there have been a lot of discussions already about why the SDK client should not know the HTTP client implementation (this is why we have the concept of transports). I obviously see the convenience of having such option available and its value, but I strongly believe that if someone wants to set it then he has to set its own client. It's not that hard after all and we're devs, so it should not be a problem for us to understand how something we're using works since it's our job...

@ste93cry ste93cry requested a review from Jean85 February 22, 2019 13:27
Copy link
Collaborator

@stayallive stayallive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the best of the worst options, best we can do right now.

Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with both @ste93cry and @stayallive: I would prefer not to include this option, but if we really must, this is the least painful way to do it.

Only required changes:

  • make it fail hard if it's misconfigured, like setting a custom transport AND a proxy
  • document it thoroughly, so the user knows that there's this limitation

src/ClientBuilder.php Outdated Show resolved Hide resolved
@HazAT HazAT requested a review from Jean85 February 22, 2019 18:43
Copy link
Collaborator

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 I've also added a test.

We should add this to the docs.

tests/ClientBuilderTest.php Outdated Show resolved Hide resolved
@ste93cry ste93cry merged commit f7f6ebc into master Feb 23, 2019
@ste93cry ste93cry deleted the feat/reintroduce-http-proxy branch February 23, 2019 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants