Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Read Stream remotely without writing it node.js

I'm trying to create a Read Stream from a remote file without writing it to disc.

var file = fs.createWriteStream('Video.mp4');
var request = http.get('http://url.tld/video.mp4', function(response){
        response.pipe(file);
});

Can I create a Read Stream directly from an HTTP response without writing it to disc ? Maybe creating a buffer in chunks and covert it to readable stream ?

like image 986
Avraham Avatar asked Sep 13 '26 18:09

Avraham


1 Answers

Seems like you can use the request module.

Have a look at 7zark7's answer here: https://stackoverflow.com/a/14552721/7189461

like image 154
Thomas D Avatar answered Sep 16 '26 08:09

Thomas D



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!