Created
November 21, 2011 21:12
-
-
Save ry/1383951 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% curl http://localhost:8000/ > outf | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 1024M 100 1024M 0 0 20.2M 0 0:00:50 0:00:50 --:--:-- 19.8M | |
% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dd if=/dev/zero of=bigfile bs=1024 count=1048576 | |
var http = require('http'); | |
var fs = require('fs'); | |
var stat = fs.statSync('bigfile'); | |
console.log(stat); | |
var s = http.Server(function(req, res) { | |
res.writeHead(200, { | |
'Content-Length': stat.size | |
}); | |
fs.ReadStream('bigfile').pipe(res); | |
}); | |
s.listen(8000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment