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

Adding selfHandleResponse option parameter to Proxy policy #949

Closed
wants to merge 3 commits into from

Conversation

josemf
Copy link

@josemf josemf commented Sep 25, 2019

Adding selfHandleResponse and sending the option to node-http-proxy is important to enable processing responses from proxied backends.

Usually node-http-proxy pipes the proxied response through existing response stream. This can be disabled by selfHandleResponse. I supply an implementation suggestion for sending the proxied response through express res.send().

Plugins might monkey patch this method to effectively intercept and handle express gateway responses. As I do in: https://github.com/josemf/express-gateway-plugin-errors.

@XVincentX
Copy link
Member

I'm sorry I haven't been able to jump on this yet.

@josemf
Copy link
Author

josemf commented Oct 8, 2019

@XVincentX that's ok,

I'm not even sure this is the best way do implement this, I mean we could just pass the selfHandleResponse to the proxy and expose http-proxy instance so a specific implementation (ex: https://github.com/josemf/express-gateway-plugin-errors) could hook to it and decide how responses should be handled.

Take your time, I just think express-gateway could offer some options for proxy data response handling.

🙏

@XVincentX
Copy link
Member

I'm jumping on this again now — I completely lost the context :(

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

Successfully merging this pull request may close these issues.

2 participants