Created
April 1, 2016 16:24
-
-
Save RubenVerborgh/a27669b33602c7d1f7634102032ba154 to your computer and use it in GitHub Desktop.
Connection rate test
This file contains 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
const http = require('http'); | |
const baseUrl = 'http://en.wikipedia.org/wiki/', max = 100; | |
var index = 1; | |
(function fetchNext() { | |
if (index < max) { | |
var url = baseUrl + index++; | |
console.log(`fetching ${url}`); | |
request = http.request(url); | |
request.on('response', (response) => { | |
response.on('data', () => {}); | |
}); | |
request.end(); | |
fetchNext(); | |
} | |
})(); |
This file contains 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
const http = require('http'); | |
const baseUrl = 'http://en.wikipedia.org/wiki/', max = 100; | |
var index = 1; | |
(function fetchNext() { | |
if (index < max) { | |
var url = baseUrl + index++; | |
console.log(`fetching ${url}`); | |
request = http.request(url); | |
request.on('response', (response) => { | |
response.on('data', () => {}); | |
response.on('end', fetchNext); | |
}); | |
request.end(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment