yarn why http-proxy-middleware OR npm ls http-proxy-middleware output (mask private folder names with *****)
Describe the bug (be clear and concise)
TL; DR;
When using responseInterceptor on onProxyRes, types doesn't match.
In detail...
I wanted to handle response. So I used a function on [onProxyRes] (#97 (comment)).
but I didn't get the response as I wanted..
(Response was broken and I think it's related to decompressing... it's not the issue I wanna report anyways)
So, instead of using this
proxyRes.on('data', ....)
I used responseInterceptor with your recipe
I'm using Typescript also, and unfortunately,
responseInterceptor's return value doesn't comply to onProxyRes.
Step-by-step reproduction instructions
I attached my code here.
https://gist.github.com/hotsummmer/387aba337e4a62ee0182a4587995f3db
Expected behavior (be clear and concise)
responseInterceptor expects arguments as below
(buffer: Buffer, proxyRes: http.IncomingMessage, req: http.IncomingMessage, res: http.ServerResponse)
but if I want to use it directly onProxyReq,
types doesn't match.
Because onProxyRes expects this type.
onProxyRes: (
proxyRes: IncomingMessage,
req: Request,
res: Response,
): void
It works if I use any as expected type... or convert types before passing it to responseInterceptor.
But wanted to ask you first about this issue
What http-proxy-middleware configuration are you using?
Line 16~33.
https://gist.github.com/hotsummmer/387aba337e4a62ee0182a4587995f3db
What OS/version and node/version are you seeing the problem?
Additional context (optional)
I appreciate your work and wonderful recipes!
Happy to use it and contribute :) thanks ❤️
yarn why http-proxy-middlewareORnpm ls http-proxy-middlewareoutput (mask private folder names with *****)http-proxy-middleware.Describe the bug (be clear and concise)
TL; DR;
When using responseInterceptor on onProxyRes, types doesn't match.
In detail...
I wanted to handle response. So I used a function on [onProxyRes] (#97 (comment)).
but I didn't get the response as I wanted..
(Response was broken and I think it's related to decompressing... it's not the issue I wanna report anyways)
So, instead of using this
I used
responseInterceptorwith your recipeI'm using Typescript also, and unfortunately,
responseInterceptor's return value doesn't comply to onProxyRes.
Step-by-step reproduction instructions
Expected behavior (be clear and concise)
responseInterceptorexpects arguments as belowbut if I want to use it directly onProxyReq,
types doesn't match.
Because
onProxyResexpects this type.It works if I use
anyas expected type... or convert types before passing it to responseInterceptor.But wanted to ask you first about this issue
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
I appreciate your work and wonderful recipes!
Happy to use it and contribute :) thanks ❤️