{"id":34737845,"url":"https://github.com/rethab/combinatorrent","last_synced_at":"2026-05-26T11:30:59.386Z","repository":{"id":148229803,"uuid":"21789550","full_name":"rethab/combinatorrent","owner":"rethab","description":"A bittorrent client written in Haskell","archived":false,"fork":false,"pushed_at":"2014-07-16T15:13:55.000Z","size":2076,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-27T17:19:35.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rethab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-13T12:10:17.000Z","updated_at":"2023-03-27T20:37:18.368Z","dependencies_parsed_at":"2023-03-27T19:17:14.420Z","dependency_job_id":null,"html_url":"https://github.com/rethab/combinatorrent","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/rethab/combinatorrent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rethab%2Fcombinatorrent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rethab%2Fcombinatorrent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rethab%2Fcombinatorrent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rethab%2Fcombinatorrent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rethab","download_url":"https://codeload.github.com/rethab/combinatorrent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rethab%2Fcombinatorrent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33518581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T03:12:49.672Z","status":"ssl_error","status_checked_at":"2026-05-26T03:12:47.976Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-25T03:44:00.449Z","updated_at":"2026-05-26T11:30:59.380Z","avatar_url":"https://github.com/rethab.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Combinatorrent - a bittorrent client.\n=====================================\n\nIntroduction\n----------\n\nThis is a bittorrent client. I am the introduction document and I need to be\nwritten by some generous soul!\n\nInstallation\n------------\n\nHere is what I do to install haskell torrrent locally on my machine:\n\n    cabal install --prefix=$HOME --user\n\nSince we are using the magnificient cabal, this is enough to install haskell\ntorrent in our $HOME/bin directory.\n\nUsage\n-----------------\n\nCombinatorrent can currently only do one very simple thing. If you call it with\n\n    Combinatorrent foo.torrent\n\nthen it will begin downloading the file in foo.torrent to the current\ndirectory via the Bittorrent protocol.\n\nProtocol support\n----------------\n\nCurrently haskell-torrent supports the following BEPs (See the\n[BEP Process](http://www.bittorrent.org/beps/bep_0000.html) document for an\nexplanation of these)\n\n   - 0003, 0004, 0006, 0010, 0020,\n\nCombinatorrent implicitly supports these extensions\n\n   - 0027: Support by the virtue of only supporting a single tracker and no\n     DHT.\n\nPartially supported extensions:\n\n   - 0007: Combinatorrent understands and uses the \"peers6\" response from\n     the tracker to connect clients. On the other hand, it does nothing to\n     provide the \"ipv4=\" and \"ipv6=\" keys on tracker requests. As such, it\n     can be claimed that 0007 support is available, as everything we left\n     out is only qualified as MAY.\n\n   - 0023: Combinatorrent supports the \"compact\" response only, although it\n     is explicitly stated that the client must support both. In practice it\n     has little impact as all modern trackers will only return compact\n     responses anyway.\n\nCombinatorrent is not supporting these BEPs, but strives to do so one day:\n\n   - 0005, 0009, 0012, 0015, 0016, 0017, 0018, 0019, 0021, 0022,\n     0024, 0026, 0028, 0029, 0030, 0031, 0032\n\nDebugging\n---------\n\nFor debugging, jlouis tends to use the following:\n\n    make conf build test\n\nThis builds Combinatorrent with the *Debug* flag set and also builds the\nsoftware with profiling by default so it is easy to hunt down performance\nregressions. It also runs the internal test-suite for various values. There\nare a couple of interesting targets in the top-level Makefile\n\nReading material for hacking Combinatorrent:\n--------------------------------------------\n\n   - [Protocol specification - BEP0003](http://www.bittorrent.org/beps/bep_0003.html):\n     This is the original protocol specification, tracked into the BEP\n     process. It is worth reading because it explains the general overview\n     and the precision with which the original protocol was written down.\n\n   - [Bittorrent Enhancement Process - BEP0000](http://www.bittorrent.org/beps/bep_0000.html)\n     The BEP process is an official process for adding extensions on top of\n     the BitTorrent protocol. It allows implementors to mix and match the\n     extensions making sense for their client and it allows people to\n     discuss extensions publicly in a forum. It also provisions for the\n     deprecation of certain features in the long run as they prove to be of\n     less value.\n\n   - [wiki.theory.org](http://wiki.theory.org/Main_Page)\n     An alternative description of the protocol. This description is in\n     general much more detailed than the BEP structure. It is worth a read\n     because it acts somewhat as a historic remark and a side channel. Note\n     that there are some commentary on these pages which can be disputed\n     quite a lot.\n\n   - [\"Supervisor Behaviour\"](http://erlang.org/doc/design_principles/sup_princ.html)\n     From the Erlang documentation. How the Erlang Supervisor behaviour\n     works. The Supervisor and process structure of Combinatorrent is\n     somewhat inspired by the Erlang ditto.\n\nSource code Hierarchy\n---------------------\n\n   - **Data**: Data structures.\n      - **Queue**: Functional queues. Standard variant with two lists.\n      - **PendingSet**: A wrapper around Data.PSQueue for tracking how\n        common a piece is.\n      - **PieceSet**: BitArrays of pieces and their operations.\n\n   - **Process**: Process definitions for the different processes comprising\n                  Combinatorrent\n      - **ChokeMgr**: Manages choking and unchoking of peers, based upon the current speed of the peer\n        and its current state. Global for multiple torrents.\n      - **Console**: Simple console process. Only responds to 'quit' at the moment.\n      - **DirWatcher**: Watches a directory and adds any torrent present in\n        it.\n      - **FS**: Process managing the file system.\n      - **Listen**: Not used at the moment. Step towards listening sockets.\n      - **Peer**: Several process definitions for handling peers. Two for sending, one for receiving\n        and one for controlling the peer and handle the state.\n      - **PeerMgr**: Management of a set of peers for a single torrent.\n      - **PieceMgr**: Keeps track of what pieces have been downloaded and what are missing. Also hands\n        out blocks for downloading to the peers.\n      - **Status**: Keeps track of uploaded/downloaded/left bytes for a single torrent. Could be globalized.\n      - **Timer**: Timer events.\n      - **TorrentManager**: Manages torrents at the top-level.\n      - **Tracker**: Communication with the tracker.\n\n   - **Protocol**: Modules for interacting with the various bittorrent protocols.\n      - **BCode**: The bittorrent BCode coding. Used by several protocols.\n      - **Wire**: The protocol used for communication between peers.\n\n   - **Top Level**:\n      - **Channels**: Various Channel definitions.\n      - **Combinatorrent**: Main entry point to the code. Sets up processes.\n      - **Digest**: SHA1 digests as used in the bittorrent protocol.\n      - **FS**: Low level Filesystem code. Interacts with files.\n      - **Process**: Code for Erlang-inspired processes.\n      - **RateCalc**: Rate calculations for a network socket. We use this to keep track of the\n        current speed of a peer in one direction.\n      - **Supervisor**: Erlang-inspired Supervisor processes.\n      - **Test.hs**: Code for test-framework\n      - **TestInstance.hs**: Various helper instances not present in the test framework by default\n      - **Torrent**: Various helpers and types for Torrents.\n      - **Tracer**: Code for simple \"ring\"-like tracing.\n      - **Version.hs.in**: Generates **Version.hs** via the configure script.\n\n\u003c!-- vim: filetype=none tw=76 expandtab\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frethab%2Fcombinatorrent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frethab%2Fcombinatorrent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frethab%2Fcombinatorrent/lists"}