diff --git a/lib/caronte/streams/proxy.js b/lib/caronte/streams/proxy.js index 713550c84..c6b75c498 100644 --- a/lib/caronte/streams/proxy.js +++ b/lib/caronte/streams/proxy.js @@ -29,12 +29,18 @@ ProxyStream.prototype.onFinish = function() { } -ProxyStream.prototype.onResponse = function() { - +ProxyStream.prototype.onResponse = function(proxyRes) { + this.proxyRes = proxyRes; } -ProxyStream.prototype._read = function() {} +ProxyStream.prototype._write = function(chunk, encoding, callback) { + this.proxyReq.write(chunk, encoding, callback); +}; + +ProxyStream.prototype._read = function(size) { + var chunk = (this.proxyRes ? this.proxyRes.read(size) : '') || ''; -ProxyStream.prototype._write = function() {} + this.push(chunk); +}; require('util').inherits(ForwardStream, Duplex); \ No newline at end of file