refactor(#1136): replace http-proxy w/ httpxy#1160
Conversation
|
Hi @SukkaW Thanks for the PR! Didn't know about Did a quick check and looks really nice so far. Most of the types are working. Found a small issue in the typing where
Added an extra check to prevent 🔧 Can you rebase with master? http-proxy-middleware/test/types.spec.ts Lines 393 to 401 in 6436ffc |
The After |
b1801dd to
c10521e
Compare
|
@chimurai Also, I am currently actively working on httpxy's HTTP/2 listener support (unjs/httpxy#38). Update: almost done unjs/httpxy#102 |
|
@chimurai Hello, what else is required for the PR to merge? All TypeScript error has been fixed and the lint is now happy. |
|
@chimurai Just a friendly ping, would you like to review this? All TypeScript errors have been fixed, the lint is happy, and all the tests have passed. |
13848fb to
548b23c
Compare
|
Hi @SukkaW. Thanks for the reminder. PR looks good. CI is failing because patches need to be removed which are not needed anymore:
You can verify if the other patches are still needed with: yarn patch-packageOnce this is fixed, this PR can be merged 👍 |
There was a problem hiding this comment.
Pull request overview
This PR attempts to resolve #1136 by replacing the unmaintained http-proxy dependency with httpxy, updating the middleware implementation and exported types to match httpxy’s API/behavior.
Changes:
- Swap
http-proxy/@types/http-proxyforhttpxyand update lockfile/spellcheck dictionary. - Refactor core proxying logic to use
httpxy’s promise-basedweb/wsAPIs and adjust error handling + shutdown behavior. - Update public TypeScript types and response interception types to align with the new proxy library.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Replaces proxy dependency with httpxy (but note patch-package implications). |
yarn.lock |
Removes http-proxy transitive deps and adds httpxy. |
tsconfig.json |
Enables skipLibCheck. |
src/http-proxy-middleware.ts |
Migrates to httpxy (createProxyServer, async web/ws), adjusts error emitting and close handling. |
src/types.ts |
Switches exported proxy types from http-proxy to httpxy and redefines event callback shapes. |
src/plugins/default/proxy-events.ts |
Adjusts on option iteration to improve typing/narrowing. |
src/plugins/default/error-response-plugin.ts |
Changes error guard condition for rethrow behavior. |
src/handlers/response-interceptor.ts |
Corrects proxyRes typing to http.IncomingMessage and updates decompression call site. |
cspell.json |
Adds httpxy to allowed words list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
548b23c to
dacea34
Compare
|
cc @chimurai I have rebased the PR to the latest master, and I have dropped |
|
Kudos! |
commit: |
dacea34 to
eb2449c
Compare
|
Many thanks @SukkaW and @bjohansebas (with the previous attempt) for helping out with the upgrade. Special thanks to @pi0 for the continuation of You guys made a long waited upgrade possible 🙏 I published a beta version: Please let me know if there are any issues. |
|
Hi Sukka.
Really good point. Definitely sense to take this opportunity.
I'll update the roadmap 👍
…On Sat, Apr 4, 2026 at 8:47 AM Sukka ***@***.***> wrote:
*SukkaW* left a comment (chimurai/http-proxy-middleware#1160)
<#1160 (comment)>
I published a beta version: npm i ***@***.***
Please let me know if there are any issues.
@chimurai <https://github.com/chimurai> Actually, if we are going into a
new major version bump (v4) anyway, maybe it is possible to include the
latest ***@***.*** in v4. After all, it is a golden opportunity to bump
the Node.js support range.
—
Reply to this email directly, view it on GitHub
<#1160 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE77COIVT3RHH7OOEIONBD4UCVXFAVCNFSM6AAAAACULABFGOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCOBWGYYDGOBWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|






Description
Another attempt to fix #1136.
Unlike #1159, instead of replacing
http-proxyw/http-proxy-3, the PR chooseshttpxy, because:httpxyis way more popular and more battle-tested:http-proxy-3only has about 45K weekly downloads right nowhttpxyhas about 1.1M weekly downloads right nowhttpxyhas a smaller installation size, hence a smaller footprint:http-proxy-3has 2 dependencies, its installation size is about 185 KiB (https://pkg-size.dev/http-proxy-3)httpxyhas 0 dependency (!) and its installation size is only 57 KiB (https://pkg-size.dev/httpxy)http-proxy-3claims it is used by the Vite,httpxyis actually widely used by the Nuxt.js community, and is actually getting contributions from the Vite.js Team (refactor!: code improvements unjs/httpxy#78)!Motivation and Context
See #1136
How has this been tested?
Unlike #1159, I actually get all the tests to pass and TypeScript happy! You can check the action log here: SukkaW#1
Types of changes
Checklist: