Checks
Describe the bug (be clear and concise)
TS compilation error occurs with compatible response & reply primitives.
I expect a type signature from createProxyMiddleware to yield: (req: IncomingMessage, res: http.ServerResponse, next?: ...) => void. However, the returned handler is explicitly coupled to express: (req: expresscore.Request, res: expresscore.Response), etc.
This is invalid.
When my server tries to then:
server.use((req, res, next) => myProxyMiddleware(req,res,next))`
i get a compilation error, because i'm using raw node interfaces (legit works!), but createProxyMiddleware demands express.js handlers.
Step-by-step reproduction instructions
TypeScript concern only
1. create a typescript project
2. install a non-express server, such as fastify & middie
3. try passing a `req: IncomingMessage` and `res: http.ServerResponse` into a `createProxyMiddleware(...)(req, res)`
4. observe compilation error
Expected behavior (be clear and concise)
No compilation error
How is http-proxy-middleware used in your project?
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
n/a
Checks
http-proxy-middleware.Describe the bug (be clear and concise)
TS compilation error occurs with compatible response & reply primitives.
I expect a type signature from
createProxyMiddlewareto yield:(req: IncomingMessage, res: http.ServerResponse, next?: ...) => void. However, the returned handler is explicitly coupled to express:(req: expresscore.Request, res: expresscore.Response), etc.This is invalid.
When my server tries to then:
i get a compilation error, because i'm using raw node interfaces (legit works!), but createProxyMiddleware demands express.js handlers.
Step-by-step reproduction instructions
Expected behavior (be clear and concise)
No compilation error
How is http-proxy-middleware used in your project?
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
n/a