• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Haskell
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A bittorrent client, for learning purposes

haze

MIT license

Small bittorrent client, written in Haskell.

The main goal of this project is to provide a clear implementation of the Bittorrent protocol in Haskell. Providing good performance is also something that would be good to achieve, but reaching the completeness of something like libtorrent or transmission is out of the scope of this project.

Examples

Here's a gif of the progress display

Usage

Usage: haze TORRENT_FILE [-o|--output-dir DIRECTORY] [-l|--log-file LOG_FILE]
            [-p|--port PORT] [-v|--version]
  Download the torrent in TORRENT_FILE

Available options:
  TORRENT_FILE             The torrent file to download
  -o,--output-dir DIRECTORY
                           The directory to download the torrent to
  -l,--log-file LOG_FILE   Logging will happen to this file if set
  -p,--port PORT           The port to listen for incoming connections on
  -h,--help                Show this help text
  -v,--version             Display what version the program is using

After launching haze with a torrent, it will show a progress display with ongoing information on the status of the torrent. Once the torrent has finished downloading, haze will continue to seed it until the program is cancelled (using CTRL-C is fine).

By default, haze will output the torrent files to the current directory, although if a torrent has multiple files, it will usually define a relative root, and files will end up there instead. Using a folder for the output is recommended for single file torrents, since many small files are generated while downloading the torrent, before they get glued together to make up the large file. These files might otherwise temporarily clutter up a folder you want to keep clean, so be wary of that.

At the moment, haze only supports downloading a single torrent file at once.

haze can perform logging to a file if specified, otherwise no logging is done. The logging exists mainly for debug purposes, although it might be interesting to look at to gleam some more about how the program works :)

Resources

The main resource I used for learning about the specification is here: https://wiki.theory.org/index.php/BitTorrentSpecification

The above page is enough to understand the spec, but it takes a few reads to grok all the information.

More Repositories

1

alchemy

A discord library for Elixir
Elixir
157
star
2

haskell-in-haskell

Trying to write an understandable implementation of Haskell, in Haskell
Haskell
119
star
3

saferith

Constant time big numbers for Go
Go
97
star
4

cait-sith

Threshold ECDSA via Triples
Rust
72
star
5

seed-split

Splitting seed phrases into shares
Rust
63
star
6

boo-hoo

An implementation of ZKBoo
Rust
33
star
7

yao-gc

A basic implementation of Yao's Garbled Circuits
Rust
30
star
8

ludus

A pluggable NES emulator
Rust
29
star
9

multiset-hash

A small crate for hashing multi sets
Rust
14
star
10

magikitten

Easy Fiat-Shamirization using Meow
Rust
13
star
11

meow

Rust
13
star
12

deevee

Designatived verifier Schnorr signatures
Rust
13
star
13

poline

Tiny language with green threads
Rust
10
star
14

persistent-ts

Persistent data structures for Typescript
TypeScript
9
star
15

nimotsu

Rolling some crypto for PGP-esque public key message sending
Rust
9
star
16

kyokusen

Elliptic Curves for Cryptography
Go
9
star
17

viviani

Elixir
8
star
18

cauchy

A hardware accelerated complex function plotter
Rust
7
star
19

bittrickle

UDP bittorrent tracker
Rust
7
star
20

Rem-Boo

Fast ZK proofs over boolean circuits with RAM
Rust
6
star
21

ginkou

Japanese sentence bank program. Add and find sentences for language learning.
Rust
6
star
22

nuntius

Having fun making an E2E messaging app
Go
6
star
23

serve-csv

Create a web API from static csv files
Go
5
star
24

raymarch

Rust
5
star
25

populate

Populate a music library based on a descriptive file
Haskell
5
star
26

hax

A bullet hell game in haskell
Haskell
4
star
27

arbor

A rusty replacement for the `tree` command
Rust
4
star
28

nicer-mecab

Japanese morphological analysis. Wrapper over mecab.
Rust
4
star
29

polka

A C compiler, using the most advanced version of Scala
Scala
4
star
30

eddo

Playing around with Ed25519 signatures
Rust
4
star
31

Advent-2018

Haskell
4
star
32

ovis

Simple functional programming language
Rust
4
star
33

chika

A low level procedural language, compiling to assembly
Rust
4
star
34

iku

WIP programming language
Rust
3
star
35

typhoon

A decent bittorrent library and program
Rust
3
star
36

advent

Advent of code solutions
Haskell
3
star
37

ludus-emu

An NES emulator using the ludus crate
Rust
3
star
38

haisou-chan

A library for simulating network delays
Rust
3
star
39

modular-protocol-security-paper

TeX
3
star
40

peerbin

Peer based code sharing site
JavaScript
3
star
41

strix

Rust
2
star
42

alchaline

Elixir
2
star
43

delay-coin

Playing around with a cryptocurrency based on verifiable delay functions.
Rust
2
star
44

Kirbot-1.5

A simple discord bot, written in python
Python
2
star
45

dex

Pokedex viewing app
JavaScript
2
star
46

talks

TypeScript
2
star
47

sally

Learning how to make a basic shell in C
C
2
star
48

mpc-for-group-reconstruction-circuits

TeX
2
star
49

butterfly-test

Testing an algorithm for creating routing networks from permutations
Jupyter Notebook
2
star
50

big-boo

Experimenting with fast symmetric ZK proofs of knowledge
Rust
2
star
51

katex-playground

Play around with katex in your browser!
TypeScript
2
star
52

toy-stark

A toy implementation of the STARK protocol
Rust
2
star
53

wordle

Playing around with the infamous word game hit of 2022
Rust
2
star
54

mariner

An experiment in ZK circuit DSLs
Rust
2
star
55

omocha

A toy blockchain
Rust
2
star
56

solopong

A simple pong game
TypeScript
1
star
57

lambdabot

Elixir
1
star
58

chess

TypeScript
1
star
59

conway

Playing around with Conway's game of life
Haskell
1
star
60

alg-intro-exercises

C++
1
star
61

ripple

Decentralised IRC-like service
Go
1
star
62

huffman-rs

An implementation of Huffman coding
Rust
1
star
63

ludus-web

Seeing if I can get my NES emulator to work through WASM
HTML
1
star
64

micro-ecs

A small ecs framework for TypeScript
TypeScript
1
star
65

CSES

Solutions to https://cses.fi/problemset/
C++
1
star
66

musync

Configuration based music syncing
Go
1
star
67

srhub

Elixir
1
star
68

aldash

Elixir
1
star
69

on-security-against-time-traveling-adversaries

TeX
1
star
70

bridger

Elixir
1
star
71

kirbot

Elixir
1
star
72

hirch

Haskell
1
star
73

web-craft

WebGL voxel game
TypeScript
1
star
74

reg-viz

Visualizing Regular Expressions
Haskell
1
star
75

disco-old

Haskell
1
star
76

advent-2022

Rust
1
star
77

scroll

Little dungeon crawler
TypeScript
1
star
78

parcel-ts-react-demo

An example of using Typescript & React with Parcel
TypeScript
1
star
79

wahlbergdown

Silly language for the https://github.com/langjam/jam0001
Rust
1
star
80

cici

A self-hosting C compiler
C
1
star
81

ck-dodo

Double odd curve(s)
Rust
1
star