Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Nov 5, 2014
1 parent f43af60 commit 4af5e33
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions 06/transfer.js
Expand Up @@ -5,9 +5,15 @@ for (var i = 0; i < 1024 * 10; i++) {
helloworld += "a";
}

// helloworld = new Buffer(helloworld);
var str = helloworld;
var buf = new Buffer(helloworld);

http.createServer(function (request, response) {
response.writeHead(200);
response.end(helloworld);
}).listen(8001);
http.createServer(function (req, res) {
res.writeHead(200);
if (req.url === '/str') {
res.write(helloworld);
} else {
res.write(buf);
}
res.end();
}).listen(8000);

0 comments on commit 4af5e33

Please sign in to comment.