Created
September 28, 2014 19:57
-
-
Save KOBA789/789b325a35a6be8630ef 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
| 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