From ebd541e21df16a8c54820dea3cb1f09fd8808ac4 Mon Sep 17 00:00:00 2001 From: James Yang <26634873@qq.com> Date: Sun, 19 Nov 2017 10:45:33 +0800 Subject: [PATCH] Update README.md --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index a5ab215..89b0a72 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,7 @@ var httpHeaders = require('http-headers') // create TCP server net.createServer(function (c) { - var buffers = [] - c.on('data', buffers.push.bind(buffers)) - c.on('end', function () { - var data = Buffer.concat(buffers) - + c.on('data', function (data) { // parse incoming data as an HTTP request and extra HTTP headers console.log(httpHeaders(data)) })