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

Middleware #140

Closed
bartvanhoutte opened this issue Nov 21, 2019 · 7 comments
Closed

Middleware #140

bartvanhoutte opened this issue Nov 21, 2019 · 7 comments

Comments

@bartvanhoutte
Copy link

Any plans on adding middleware to the client? I'm looking to collect statistics on HTTP requests.

@bartvanhoutte
Copy link
Author

Created a PR, #141. Only supports intercepting the request so far.

@clue
Copy link
Owner

clue commented Nov 29, 2019

@bartvanhoutte Thanks for reporting, the feature request makes perfect sense!

We have to to figure out a decent API, but it looks like #141 might be a good starting point to discuss this 👍

@bartvanhoutte
Copy link
Author

PR #141 at the moment only supports altering a request. Altering a response seems fairly straightforward, but it would be nice if we could make it work with streaming enabled as well.

Also, it would be nice to be able to do both things in one and the same middleware, this would provide a nice way of doing things for #49 - adding the Content-Encoding header to the request and deflate the response in one middleware. Does this make sense?

@TaelmanTim
Copy link

@clue Any updates for this issue?

@clue
Copy link
Owner

clue commented Feb 19, 2020

As much as I'd like to commit to specific date, I can only say that I will get back to this feature as soon as time permits.

I still think that this feature makes perfect sense 👍 However, there are currently no immediate plans to build this from my end (no demand at the moment and more important outstanding issues currently), but I would be really happy to accept PRs 👍

(If you need this for a commercial project and you want to help sponsor this feature, feel free to reach out and send me an email)

@jcchavezs
Copy link

I want to introduce distributed tracing middleware for this client, it would be really cool if we could have a middleware API for this.

@clue
Copy link
Owner

clue commented Jul 12, 2020

Again thanks for bringing this up! I have to close this one as per #177 now that future development will focus on https://github.com/reactphp/http instead. If you feel this makes sense to port over, please file a new ticket over in the new repo and I'm happy to help review this 👍

@clue clue closed this as completed Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants