Skip to content

logotip4ik/tozi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

228 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tozi

Torrent downloader or leecher.
pronounced as TOZ-ee

Usage

tozi download|continue|verify|info ./path/to/file.torrent|magnet link

Building

zig build

Why ?

  • learn kqueue, torrent proto and zig
  • replace motrix
  • fast
  • mine (?)

Notes

  • there is no seeding capability, because almost nobody would have a server that is available to the public web. This means nobody can connect to you (unless you messed with your network setup, which I didn't do).
  • there is no linux support, because I didn't write epoll wrapper and I didn't use pre-built libraries.
  • file read/writes are "blocking". I think i will change this with zig 0.16.0. But to be honest, I didn't find it to be a bottleneck, because usually the network is saturated first. File and hashing are now done in separate threads. It turned out to be easier than i expected. Also discovered new thing std.posix.pipe for threads communications. It integrated nicely with kqueue.
  • udp tracker support. Learned that udp is also quite cool, because you receive either whole packet or nothing, which is perfect for torrent tracker.

Support

  • BEP-003: Core protocol (I'm not entierly sure this is 100% compliant, but it still downloads torrents)
  • BEP-006: Fast extension
  • BEP-009: Extension for Metadata Files (TODO: add support for sending metadata messages)
  • BEP-010: Extension Protocol
  • BEP-011: Peer Exchange (PEX)
  • BEP-012: Multiple trackers
  • BEP-015: UDP Tracker Protocol for BitTorrent (TODO: add reties)
  • BEP-020: Peer ID Conventions
  • BEP-023: Tracker Returns Compact Peer Lists
  • BEP-040: Canonical Peer Priority
  • BEP-054: The lt_donthave extension

About

torrent + zig

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages