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; }