diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ee58786..a4b27e4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v2.0.5](https://github.com/chimurai/http-proxy-middleware/releases/tag/v2.0.5) + +- fix(error handler): add default handler to econnreset ([#759](https://github.com/chimurai/http-proxy-middleware/pull/759)) + ## [v2.0.4](https://github.com/chimurai/http-proxy-middleware/releases/tag/v2.0.4) - fix(fix-request-body): improve content type check ([#725](https://github.com/chimurai/http-proxy-middleware/pull/725)) ([kevinxh](https://github.com/kevinxh)) diff --git a/package.json b/package.json index 079120f4..dfe51dc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "http-proxy-middleware", - "version": "2.0.4", + "version": "2.0.5", "description": "The one-liner node.js proxy middleware for connect, express and browser-sync", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/_handlers.ts b/src/_handlers.ts index 6cdefd79..9d3be970 100644 --- a/src/_handlers.ts +++ b/src/_handlers.ts @@ -11,6 +11,10 @@ export function init(proxy: httpProxy, option: Options): void { proxy.on(eventName, handlers[eventName]); } + proxy.on('econnreset', (err, req, res, target) => { + logger.error(`[HPM] ECONNRESET: %s`, err); + }); + logger.debug('[HPM] Subscribed to http-proxy events:', Object.keys(handlers)); }