Browse Source

bench: add /echo endpoint to http_simple

Copies the POST request data verbatim into the response body.
v0.7.4-release
Ben Noordhuis 13 years ago
parent
commit
8b2abed03d
  1. 6
      benchmark/http_simple.js

6
benchmark/http_simple.js

@ -54,6 +54,12 @@ var server = http.createServer(function (req, res) {
} else if (command == "fixed") {
body = fixed;
} else if (command == "echo") {
res.writeHead(200, { "Content-Type": "text/plain",
"Transfer-Encoding": "chunked" });
req.pipe(res);
return;
} else {
status = 404;
body = "not found\n";

Loading…
Cancel
Save