Why is fs.createReadStream … pipe(res) locking the read file?
问题 I'm using express to stream audio & video files according to this answer. Relevant code looks like this: function streamMedia(filePath, req, res) { // code here to determine which bytes to send, compute response headers, etc. res.writeHead(status, headers); var stream = fs.createReadStream(filePath, { start, end }) .on('open', function() { stream.pipe(res); }) .on('error', function(err) { res.end(err); }) ; } This works just fine to stream bytes to <audio> and <video> elements on the client.