Skip to content

Instantly share code, notes, and snippets.

@mape
Created August 22, 2010 19:18
Show Gist options
  • Save mape/544150 to your computer and use it in GitHub Desktop.
Save mape/544150 to your computer and use it in GitHub Desktop.
createRequestProxy = function () {
return new RequestProxy();
};
var RequestProxy = fs.RequestProxy = function () {
events.EventEmitter.call(this);
var body = '';
this.end = function() {
fetchCallback(null, body);
}
this.write = function(data) {
body += data.toString('binary');
}
};
sys.inherits(RequestProxy, events.EventEmitter);
var outStream = createRequestProxy();
request({'uri': filePath, 'responseBodyStream': outStream}, function(){});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment