Notable changes
-
Switched proxy from
http-proxytohttpxy✨
This replaces a long-standing core dependency and brings in many upstream fixes and behavior improvements documented by thehttpxyproject: unjs/httpxy#2. -
ESM-only package [BREAKING CHANGE] 💣
http-proxy-middlewarenow ships as native ES modules only. CommonJSrequire()usage is no longer supported, so imports should use ESM syntax. -
Updated Node.js support policy [BREAKING CHANGE] 💣
Dropped Node.js 14, 16, 18, and 20.
New minimum supported runtime is Node.js 22.15.0 -
Removed
legacyCreateProxyMiddleware()[BREAKING CHANGE] 💣
The legacy compatibility wrapper has been removed as part of API cleanup. UsecreateProxyMiddleware()directly. -
Added IPv6 literal support ✨
targetandforwardnow support literal IPv6 URLs, for example:http://[::1]:3000. -
Experimental Hono support 🧪
AddedcreateHonoProxyMiddleware()for Hono apps, including dedicated subpath support viahttp-proxy-middleware/hono.
Many thanks to everyone who helped make this release possible. 🙏
What's Changed
- fix(types): fix Logger type by @chimurai in #1104
- fix(fixRequestBody): support text/plain by @knudtty in #1103
- chore(examples): bump deps by @chimurai in #1105
- build(prettier): improve prettier setup by @chimurai in #1108
- chore(deps): fix punycode node deprecation warning by @chimurai in #1109
- chore(examples): bump deps by @chimurai in #1110
- build(codespaces): add devcontainer.json by @chimurai in #1112
- chore(package): bump dev dependencies by @chimurai in #1116
- ci(github-action): ci.yml add node v24 by @chimurai in #1117
- chore(package): bump dev dependencies by @chimurai in #1118
- chore(package): upgrade to jest v30 by @chimurai in #1122
- chore(examples): upgrade deps by @chimurai in #1124
- chore(package): update dev deps by @chimurai in #1125
- test(websocket): fix ws import by @chimurai in #1126
- chore(refactor): use
node:protocol imports by @chimurai in #1127 - ci(node24): pin node24 due to TLS issue with mockttp by @chimurai in #1137
- docs(recipes/pathRewrite.md): fix comment by @DEBargha2004 in #1135
- chore(package): bump dev deps by @chimurai in #1138
- chore(deps): update actions/checkout action to v5 by @chimurai in #1140
- fix(error-response-plugin): sanitize input by @chimurai in #1141
- chore(package.json): update dev deps by @chimurai in #1143
- chore: add context7.json by @chimurai in #1144
- build(eslint): update eslint.config.mjs by @chimurai in #1145
- ci(github workflow): harden github workflows by @chimurai in #1146
- chore(package): bump dev deps by @chimurai in #1147
- ci(ci.yml): unpin node 24 by @chimurai in #1148
- docs(recipes): fix servers.md http.createServer example by @hacklschorsch in #1150
- ci: publish with oidc by @chimurai in #1152
- chore(package.json): bump dev deps by @chimurai in #1153
- chore(package.json): bump dev deps by @chimurai in #1155
- chore(package.json): bump dev deps by @chimurai in #1158
- test(types.spec.ts): add type check when req or res are 'any' by @chimurai in #1161
- chore(package.json): bump deps by @chimurai in #1164
- chore(package.json): eslint v10 by @chimurai in #1165
- chore(package.json): bump dev deps by @chimurai in #1166
- chore(package.json): bump dev-deps by @chimurai in #1171
- docs(examples): fix websocket example by @chimurai in #1170
- build(vscode): use workspace version of TypeScript by @chimurai in #1173
- refactor(#1136): replace
http-proxyw/httpxyby @SukkaW in #1160 - feat: drop node v14/v16/v18, update to es2022, remove req.connection by @bjnewman in #1162
- chore(package.json): v4.0.0-beta.0 by @chimurai in #1174
- chore: remove legacyCreateProxyMiddleware() [BREAKING CHANGE] by @chimurai in #1175
- fix: applyPathRewrite logs old req.url instead of rewritten path by @nicoabie in #1157
- fix: prevent TypeError when ws enabled but server is undefined by @bjnewman in #1163
- fix(fixRequestBody): support content-encoding on request body by @robbtraister in #1142
- refactor: remove deprecated url.parse() by @chimurai in #1176
- chore(package.json): drop node20 [BREAKING CHANGE] by @chimurai in #1179
- ci: migrate from jest to vitest by @chimurai in #1180
- chore(package.json): esm only [BREAKING CHANGE] by @chimurai in #1181
- chore(package.json): bump to httpxy 0.5.0 by @chimurai in #1183
- chore: remove third party config by @chimurai in #1184
- chore: minor improvements by @chimurai in #1185
- test: target connection errors by @chimurai in #1186
- chore(package.json): v4.0.0-beta.1 by @chimurai in #1187
- ci(github-actions): bump actions by @chimurai in #1188
- chore(package.json): bump dependencies by @chimurai in #1189
- refactor(is-plain-object): replace with is-plain-obj by @chimurai in #1191
- chore(examples): add ts-check by @chimurai in #1192
- fix(types): allow Promise return type for proxyRes callback by @cyphercodes in #1190
- feat(hono): support for hono with createHonoProxyMiddleware by @chimurai in #1193
- chore(package.json): v4.0.0-beta.3 by @chimurai in #1194
- chore(eslint): @typescript-eslint/consistent-type-imports by @chimurai in #1195
- docs(examples): sse example by @chimurai in #1196
- refactor: typescript strict types by @chimurai in #1197
- docs(examples): add Next.js v16 example by @chimurai in #1198
- docs(examples): use subpath import #http-proxy-middleware by @chimurai in #1199
- docs(fastify): fix fastify example by @chimurai in #1200
- fix(hono): use Hono HttpBindings in createHonoProxyMiddleware by @chimurai in #1201
- chore(package.json): bump deps by @chimurai in #1202
- build(oxfmt): migrate prettier to oxfmt by @chimurai in #1203
- test: improve tests by @chimurai in #1204
- docs: update docs by @chimurai in #1205
- feat(ipv6): support literal IPv6 addresses in 'target' and 'forward' options by @chimurai in #1206
- chore(ipv6): only run ipv6 e2e test in ipv6 environment by @chimurai in #1207
- test(e2e): unix domain socket (uds/ipc) by @chimurai in #1208
- chore(package.json): update dev deps by @chimurai in #1209
- chore(package.json): bump httpxy to ^0.5.1 by @chimurai in #1210
- ci(github-actions): upgrade streetsidesoftware/cspell-action to v8 by @chimurai in #1211
- docs(createProxyMiddleware): add createProxyMiddleware jsdoc by @chimurai in #1212
- chore: add E2E tests for graceful shutdown and Hono error handling by @chimurai in #1213
- chore: improve typing 'req' by @chimurai in #1214
- fix(logger-plugin): support ipv6 host and handle undefined protocol/host by @chimurai in #1215
- ci(publish.yml): pin github.triggering_actor by @chimurai in #1216
- chore(package.json): remove patch-package by @chimurai in #1217
- chore(package.json): node ^22.15.0 by @chimurai in #1218
- refactor(package): subpath 'http-proxy-middleware/hono' by @chimurai in #1220
- chore(package.json): v4.0.0-beta.6 by @chimurai in #1221
- docs: update http-proxy references to httpxy by @chimurai in #1222
- docs: minor documentation fixes by @chimurai in #1223
- chore: node 26 support by @chimurai in #1224
- chore(package.json): v4.0.0 by @chimurai in #1225
New Contributors
- @knudtty made their first contribution in #1103
- @DEBargha2004 made their first contribution in #1135
- @hacklschorsch made their first contribution in #1150
- @SukkaW made their first contribution in #1160
- @bjnewman made their first contribution in #1162
- @nicoabie made their first contribution in #1157
- @robbtraister made their first contribution in #1142
- @cyphercodes made their first contribution in #1190
Full Changelog: v3.0.5...v4.0.0