Skip to content

Instantly share code, notes, and snippets.

@Marak
Created August 31, 2015 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Marak/d37824280f8fb9ee6861 to your computer and use it in GitHub Desktop.
Save Marak/d37824280f8fb9ee6861 to your computer and use it in GitHub Desktop.
module['exports'] = function echoHttp (hook) {
if (!hook.streaming) {
return hook.res.end('No streaming request detected.');
}
hook.req.on('end', function(){
hook.res.end();
});
hook.req.on('data', function(chunk){
hook.res.write(chunk.toString())
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment