Skip to content

Instantly share code, notes, and snippets.

@KOBA789
Created September 28, 2014 19:57
Show Gist options
  • Save KOBA789/789b325a35a6be8630ef to your computer and use it in GitHub Desktop.
Save KOBA789/789b325a35a6be8630ef to your computer and use it in GitHub Desktop.
var http = require('http'),
fs = require('fs');
var i = Date.now();
function run () {
http.request({
//host: '199.96.57.7',
//host: '117.18.237.139',
host: 'cs90.wac.edgecastcdn.net',
hostname: 'pbs.twimg.com',
port: 80,
method: 'GET',
path: '/favicon.ico'
}, function (res) {
i++;
var imgws = fs.createWriteStream('./favicon-' + i.toString() + '.ico');
res.pipe(imgws);
var headers = Object.keys(res.headers).map(function (key) {
return key + ': ' + res.headers[key];
}).join('\n');
fs.writeFile('./headers-' + i.toString() + '.txt', headers);
}).end();
setTimeout(run, 500);
}
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment