Readit News logoReadit News
piyushgupta53 commented on Show HN: I wrote a BitTorrent Client from scratch   github.com/piyushgupta53/... · Posted by u/piyushgupta53
jorkingit · 2 months ago
Great work! Just an FYI, you might want to limit the dynamic allocation size in the bencode decoder: since it's untrusted input (either from torrent or announce), a malicious input could DoS the client by requesting extremely large allocations during string parsing. A good upper bound could be the remaining length of the input, as a well formed torrent can't contain a string longer than the rest of the file.
piyushgupta53 · 2 months ago
thanks for pointing this out. I've added this in my to-dos.
piyushgupta53 commented on Show HN: I wrote a BitTorrent Client from scratch   github.com/piyushgupta53/... · Posted by u/piyushgupta53
vkaku · 2 months ago
Excellent, looks clean and simple.

Suggestion: Add a simple usage one liner in the README on how to actually download a .torrent file with it.

  ./go-torrent My-Linux-Distro-Wink-ISO.torrent
Suggestion: Bonus points if you add torrent.ParseFromUrl

Everyone should do this for their own spiritual journey.

piyushgupta53 · 2 months ago
thanks for the suggestion, appreciate it.
piyushgupta53 commented on Show HN: I wrote a BitTorrent Client from scratch   github.com/piyushgupta53/... · Posted by u/piyushgupta53
NooneAtAll3 · 2 months ago
Do you support magnet links?

Edit: ah, planned feature

piyushgupta53 · 2 months ago
not yet. I'll be adding soon.
piyushgupta53 commented on Show HN: I wrote a BitTorrent Client from scratch   github.com/piyushgupta53/... · Posted by u/piyushgupta53
throwaway894345 · 2 months ago
This is cool! I’ve been thinking about something like this as well. How hard was it, and do you have a sense for how “complete” it is? Does it handle DHT and Magnet and all the crazy NAT traversal stuff?

I’m guessing the main obstacle for me has always been that I’m not sure what the complete list of features is to have a client that will just work for the majority of torrents in the wild. It seems like there are dozens of protocols associated with torrenting and I don’t even know what the full list is much less what each does.

piyushgupta53 · 2 months ago
it was challenging for sure. Took me almost a month to get acquainted with the protocol, how bencoding works etc, build a mental model and then eventually writing code.

Magnet and DHT are yet to be added.

piyushgupta53 commented on A USB Interface to the "Mother of All Demos" Keyset   righto.com/2025/03/mother... · Posted by u/zdw
piyushgupta53 · 5 months ago
this is such a great read!

u/piyushgupta53

KarmaCake day97December 25, 2021View Original