Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var request = require('superagent');
- var INTERVAL = 1500;
- function rangeRequest (start, end) {
- request
- .get(//TODO your server here)
- .set('Range:', 'bytes=' + start + '-' + end)
- .set('Accept', '*/*')
- .set ('Cache-Control:','no-cache')
- .end(function(error, res){
- console.log (res);
- });
- }
- var when = Math.round(Math.random() * 10 * 1000);
- setInterval (function () {
- setTimeout (function () {
- var start = Math.round(Math.random() * 5000);
- var end = start + Math.round(Math.random() * 5000000);
- console.log ("send a random request. start, end: " + start + ", " + end);
- rangeRequest (start, end);
- }, when);
- }, INTERVAL);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement