chimurai/http-proxy-middleware ? reverse-engineered prompt

Reverse engineered prompt

Build me a Node.js proxy middleware library that makes it really easy to forward certain requests to another server, like sending all /api traffic to a different backend. I want it to work cleanly with Express, Connect, Next.js, Hono, and other similar servers, and I need it to handle both normal HTTP requests and WebSocket connections. It should let me choose which paths get proxied, rewrite paths when needed, and route different requests to different targets based on simple rules.

Please make the setup feel simple, with one main function people can drop into their app and a few practical options for common cases like changing the origin, keeping the same base path, and customizing request or response behavior. Use the current docs online if you need to check the latest server integration details. Also include a few clear examples so someone can see how to proxy a local app to another service without having to read a lot first.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab