Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bench: add /echo endpoint to http_simple

Copies the POST request data verbatim into the response body.
  • Loading branch information...
commit 8b2abed03df9bc16b37d1ac21bfc68b36dfa9f47 1 parent 432a2e4
@bnoordhuis bnoordhuis authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 benchmark/http_simple.js
View
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";
Please sign in to comment.
Something went wrong with that request. Please try again.