Koa@2.x middleware for HTTP proxying, powered by http-proxy. Version 0.0.2. Provides a simple way to proxy requests to another target with options like path rewriting, event handling, and logging. Differentiators: native Koa support (async/await), Promise-based flow, and integration with match-path-plus for URL matching. Released on npm, no recent updates.
npm install koa-http-proxy-middlewareNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a Koa server with proxy middleware redirecting /api to external API.
Ensure you call httpProxy(pattern, options) in your app.use().
Define events once; avoid using events in multiple middleware instances.
Implement custom logging via events if needed.
Use named import: import { httpProxy } from 'koa-http-proxy-middleware'Provide a URL pattern string or RegExp as first argument.