[feature] implement _write and _read

This commit is contained in:
yawnt 2013-08-09 19:40:40 +02:00
parent 4f24664e8a
commit 6a4294cbdf

View File

@ -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._write = function() {}
ProxyStream.prototype._read = function(size) {
var chunk = (this.proxyRes ? this.proxyRes.read(size) : '') || '';
this.push(chunk);
};
require('util').inherits(ForwardStream, Duplex);