Skip to content

Instantly share code, notes, and snippets.

@keithamus
Created December 5, 2013 20:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithamus/7813656 to your computer and use it in GitHub Desktop.
Save keithamus/7813656 to your computer and use it in GitHub Desktop.
A little server that I used to collect headers for https://keithamus.ghost.io/an-analysis-of-http-headers
var app = require('express')(),
fs = require('fs');
var headers = [];
app.get('/', function (req, res) {
headers.push(req.headers);
res.json(req.headers);
});
setInterval(function () {
fs.writeFileSync('headers.json', JSON.stringify(headers));
}, 10000);
require('http').createServer(app).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment