Hacker News new | ask | show | jobs
by robert-boehnke 5261 days ago
Couldn't you just connect the uploader's POST to the downloader's GET request instead of using websockets?
1 comments

This seems to be more of a streaming upload/download. Node just basically pipes along the chunks from the serving peer through the websockets.

I'm pretty sure that if you just "connect the uploader's POST to the downloader's GET" then the Node server would have to buffer the entire file from the submitter before sending it to the clients.

> I'm pretty sure that if you just "connect the uploader's POST to the downloader's GET" then the Node server would have to buffer the entire file from the submitter before sending it to the clients.

Not at all. Use stream.pipe(). I've done it countless times and it works really well.