mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[feature] implement _write and _read
This commit is contained in:
parent
4f24664e8a
commit
6a4294cbdf
@ -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);
|
||||
Loading…
x
Reference in New Issue
Block a user