Skip to content

Commit

Permalink
[feature] implement _write and _read
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Aug 9, 2013
1 parent 4f24664 commit 6a4294c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/caronte/streams/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 6a4294c

Please sign in to comment.