Solaris
Solaris

Reputation: 784

NodeJS: Download torrent as stream

TL;DR Is is possible to proxy torrent larger than available local disk while piping it to outbound stream ?

According to BitTorrent spec , all torrents are stored as pieces of equal length , I want to write a node app could pipe the torrent pieces to a http upload stream , does any library provide such functionality ? All the implementation I have found downloads the whole file to local storage then propagate it further which can cause problems when running on small disk and large files .

Upvotes: 0

Views: 854

Answers (1)

the8472
the8472

Reputation: 43125

Bittorrent is designed for random access to keep data available via the rarest-first strategy. See Section 2.4.2 of the bittorrent econ paper. While it is possible to operate it in a streaming manner anyway this generally isn't recommended and certainly shouldn't be the default, otherwise performance could severely degrade for all swarm members or content could even become unavailable.

Upvotes: 2

Related Questions