Last active
August 29, 2015 14:11
-
-
Save cristiano-belloni/22afe04aba3dde02814d to your computer and use it in GitHub Desktop.
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
var request = require('superagent'); | |
var INTERVAL = 4000; | |
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 = 5000; | |
setInterval (function () { | |
setTimeout (function () { | |
var start = 100; | |
var end = 300000; | |
console.log ("request sent"); | |
rangeRequest (start, end); | |
}, when); | |
}, INTERVAL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My version: