http-proxy-middleware is a Node.js HTTP proxy middleware for connect, express, next.js, and other compatible frameworks.
The tool solves the problem of routing requests to backend services by providing a simple, configurable middleware layer. It wraps httpxy, a maintained version of the node-http-proxy library, allowing developers to define proxy rules declaratively. Configuration centers on the createProxyMiddleware function, which accepts options like target URL, path filtering, path rewriting, and dynamic routing. The middleware integrates directly into the request handling pipeline of supported frameworks.
Developers should choose this tool when building applications that need to forward requests to external services, such as proxying API calls to a backend server or handling development-time backend integration. It suits projects using express, next.js, hono, fastify, polka, or connect. The tool handles WebSocket proxying in addition to standard HTTP requests and supports request and response interception for manipulation. Path filtering can use strings, globs, or custom functions to determine which requests to proxy, and path rewriting allows URL transformation before forwarding.
The project maintains active development with regular updates and documentation for multiple major versions. The codebase is written in TypeScript, providing type safety for users. The tool includes a plugin system allowing extensibility through custom middleware, and comprehensive examples and recipes are provided in the repository to guide adoption.