From 9969aa9582224f22eac19fba395bc2e943ec1f75 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Tue, 23 Sep 2014 14:42:13 +0200 Subject: [PATCH] Forward errors in proxy mode. --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 8491d82..c762c30 100644 --- a/index.js +++ b/index.js @@ -74,6 +74,11 @@ module.exports = function (url, opts, cb) { // pipe the response to the proxy if in proxy mode if (proxy) { res.pipe(proxy); + + res.on('error', function forwardError(error) { + proxy.emit('error', error); + }) + return; }