Answer the question
In order to leave comments, you need to log in
How to make a proxy for a file stream?
There is such a library https://github.com/request/request you need to send a form from files but before that encrypt it.
const = {
url: 'http://service.com/upload',
//...
};
const stream = fs.createReadStream('file.text');
// Так работает
const r = request.post(options).form().append('file', stream);
// так нет
const encrypt = crypto.createCipher(algorithm, password);
const r = request.post(options).form().append('file', stream.pipe(encrypt));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question