Jan Maybach
2018-07-04 13:08:36 UTC
Hi,
I have this problem, that I cannot fulfill Range-Requests.
My code:
var rangeStart =
parseInt(req.headers.range.split('=')[1].split('-')[0])
var rangeEnd = parseInt(req.headers.range.split('=')[1].split('-')[1])
res.writeHead(206, {
'content-encoding' : 'identity'
, 'Content-Type': 'multipart/byteranges'
, 'Content-Range': 'bytes ' + rangeStart + '-' + rangeEnd + '/' +
contentLength
, 'Content-Length': (rangeEnd - rangeStart) +1
, 'Accept-Ranges' : '0-' + (contentLength-1)
, 'Content-Transfer-Encoding' : 'binary'
// , 'disablevcache' : true
, 'Vary' : 'Content-Range'
});
var stream = fs.createReadStream(filePath, { start: rangeStart, end:
rangeEnd })
stream.pipe(res)
////// I made this test to see if bytes written. The file says yes.
fs.createReadStream(filePath, { start: rangeStart, end: rangeEnd
}).pipe(fs.createWriteStream('test.test'))
I use BrowserStack.
So I can see the network tab on an iPhone.
It always breaks at the second request.
0-fullByteLength.
It wants to be 5 MB.
But it stops after 500kB.
No errors.
Stuck.
You can see the live-URL here:
https://liebdich.com/ajax__flow_of_steelo__es_jesai__lieb_dich.wav.
Thanks.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/56614223-6e6a-4c6e-8983-3676d6a39c4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I have this problem, that I cannot fulfill Range-Requests.
My code:
var rangeStart =
parseInt(req.headers.range.split('=')[1].split('-')[0])
var rangeEnd = parseInt(req.headers.range.split('=')[1].split('-')[1])
res.writeHead(206, {
'content-encoding' : 'identity'
, 'Content-Type': 'multipart/byteranges'
, 'Content-Range': 'bytes ' + rangeStart + '-' + rangeEnd + '/' +
contentLength
, 'Content-Length': (rangeEnd - rangeStart) +1
, 'Accept-Ranges' : '0-' + (contentLength-1)
, 'Content-Transfer-Encoding' : 'binary'
// , 'disablevcache' : true
, 'Vary' : 'Content-Range'
});
var stream = fs.createReadStream(filePath, { start: rangeStart, end:
rangeEnd })
stream.pipe(res)
////// I made this test to see if bytes written. The file says yes.
fs.createReadStream(filePath, { start: rangeStart, end: rangeEnd
}).pipe(fs.createWriteStream('test.test'))
I use BrowserStack.
So I can see the network tab on an iPhone.
It always breaks at the second request.
0-fullByteLength.
It wants to be 5 MB.
But it stops after 500kB.
No errors.
Stuck.
You can see the live-URL here:
https://liebdich.com/ajax__flow_of_steelo__es_jesai__lieb_dich.wav.
Thanks.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/56614223-6e6a-4c6e-8983-3676d6a39c4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.