Skip to content

Instantly share code, notes, and snippets.

@hns
Created September 19, 2010 15:11
Show Gist options
  • Save hns/586826 to your computer and use it in GitHub Desktop.
Save hns/586826 to your computer and use it in GitHub Desktop.
var http = require('http');
var Buffer = require('buffer').Buffer;
http.createServer(function (req, res) {
var n = 1024, b;
for (var i = 1; i <= 30; i++)
b = new Buffer(n);
res.writeHead(200, {"Content-Type": "text/plain"});
res.end(b);
}).listen(8000);
var {ByteArray} = require('binary');
require("ringo/httpserver").Server({
app: function app(request) {
var n = 1024, b;
for (var i = 1; i <= 30; i++)
b = new ByteArray(n);
return {
status: 200,
headers: {"Content-Type": "text/plain"},
body: [b]
};
},
port: 4040
}).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment