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

Do not terminate request after proxy response. Add option to pass proxyResponse to next middleware #477

Open
hpl002 opened this issue Jan 7, 2021 · 4 comments

Comments

@hpl002
Copy link

hpl002 commented Jan 7, 2021

A feature that is missing from most proxy middleware that i have seen, and it is driving me crazy.

Response is currently terminated after proxy. I simply want to pass it along the good ol middleware stack and end the response later down the road.

Story

Validate incoming request against schema, proxy request, and then validate proxy response. If response if OK, then return proxy response to client, if not then return validation errors.


skipToNextHandlerFilter is a breath of fresh air after pulling my hair out with http-proxy-middleware. They have no fall-through option and i know for certain that this is something the users want.

skipToNextHandlerFilter does give me the ability to call my next middleware, but does not give me the option to return the proxy response in the event that the response is valid.

Allows you to inspect the proxy response, and decide if you want to continue processing (via express-http-proxy) or call next() to return control to express.

Can this be extended such that the proxyResponse is returned in next?


Kudos on a very well designed module and community involvement. Glad to see that issues are being answered and addressed.

Best

Herman

@monkpow
Copy link
Collaborator

monkpow commented Jan 8, 2021

Interesting. Thanks for the well written report. Let me look into this for a bit and I'll update you.

@sudharsans85
Copy link

+1. Any update on this? Able to relate myself to Herman - have been trying to locate a proxy middleware that allows fallthrough and pretty much no luck so far. This is the closest one - Was this taken up?

@bas080
Copy link

bas080 commented Jan 18, 2022

@sudharsans85, It requires a very small code change to enable fall-through to next middleware. I think however that this issue also does not want to end the connection so that further sending can be performed.

Should there be a separate issue for the fall-through feature?

@aemb87
Copy link

aemb87 commented Feb 1, 2024

Hi! any update on this?

Ive been able todo some things with res.expressHttpProxy as indicated in this closed issue #361 but it seems a bit obscure.

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

5 participants