multithreading - Http headers for starting a multithreaded download -
i trying create multi threaded downloader using nodejs. able download file using single thread. simple http.get request in nodejs.
to create multi threaded downloader have send http headers in request not able figure out how. want know http headers should sending able download range of bytes offset.
var http = require('http'); var options = { host: 'hostname.com', path: '/path/to/a/large/file.zip', headers: { //some headers me download part of file. } }; callback = function(response) { response.on('data', function (chunk) { //write chunk file }); } http.request(options, callback).end();
you need range
header. example given in wiki
range: bytes=500-999
for more detail see 14.35 range in http header definitions
Comments
Post a Comment