diff --git a/lib/http_duplex.js b/lib/http_duplex.js index d53d552..3a8f732 100644 --- a/lib/http_duplex.js +++ b/lib/http_duplex.js @@ -40,5 +40,11 @@ HttpDuplex.prototype._write = function (chunk, encoding, cb) { }; HttpDuplex.prototype.end = function (chunk, encoding, cb) { + this._output.destroy(); return this.req.end(chunk, encoding, cb); }; + +HttpDuplex.prototype.destroy = function () { + this.req.destroy(); + this._output.destroy(); +};