Coder Social home page Coder Social logo

rusty_torrent's Introduction

RustyTorrent

A BitTorrent client, written in Rust.

It supports:

  • Reading .torrent files (single-file torrents only)
  • Connecting to a tracker to discover peers
  • Downloading a file from multiple peers in parallel
  • Queueing multiple requests with each peer for faster downloading (aka pipelining)
  • Uploading files to peers, and seeding existing files from disk
  • Resuming partial downloads
  • Verification of correctness of downloaded chunks

Not yet:

  • Multi-file torrents
  • Connecting to multiple trackers
  • Upload throttling/congestion control
  • NAT traversal

Requirements

  • Rust 1.0.0 or later

Usage

Download and install Rust 1.0 from http://www.rust-lang.org/install.html.

Clone the repository:

git clone [email protected]:kenpratt/rusty_torrent.git
cd rusty_torrent

To run:

cargo run path/to/myfile.torrent

To run specifying a port to listen on:

cargo run -- -p 3333 path/to/myfile.torrent

Your file will be saved in the downloads/ directory.

To build and run an optimized version (will enable significantly faster downloads):

cargo run --release -- path/to/myfile.torrent
cargo run --release -- -p 3333 path/to/myfile.torrent

To watch for changes and auto-rebuild (on OS X):

gem install kicker -s http://gemcutter.org
./watch

rusty_torrent's People

Contributors

kenpratt avatar pietromenna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rusty_torrent's Issues

can not build

version

bash-3.2$ cargo --version
cargo 1.32.0-nightly (b3d0b2e54 2018-11-15)
bash-3.2$ rustc --version
rustc 1.32.0-nightly (0c999ed13 2018-12-03)
bash-3.2$

error msg

cargo run -- -p 3333 test_data/flagfromserver.torrent                           master โœ”
  Downloaded hyper v0.5.2
  Downloaded rust-crypto v0.2.31
  Downloaded getopts v0.2.11
  Downloaded url v0.2.35
  Downloaded rand v0.3.8
  Downloaded bencode v0.1.12
  Downloaded time v0.1.26
  Downloaded rustc-serialize v0.3.15
  Downloaded libc v0.1.8
  Downloaded gcc v0.3.8
  Downloaded httparse v0.1.4
  Downloaded mime v0.0.11
  Downloaded cookie v0.1.21
  Downloaded unicase v0.1.0
  Downloaded num_cpus v0.2.6
  Downloaded openssl v0.6.2
  Downloaded log v0.3.1
  Downloaded matches v0.1.2
  Downloaded byteorder v0.3.10
  Downloaded num v0.1.25
  Downloaded openssl-sys v0.6.2
  Downloaded lazy_static v0.1.11
  Downloaded bitflags v0.1.1
  Downloaded pkg-config v0.3.4
   Compiling pkg-config v0.3.4
   Compiling gcc v0.3.8
   Compiling libc v0.1.8
   Compiling lazy_static v0.1.11
   Compiling bitflags v0.1.1
   Compiling matches v0.1.2
   Compiling rustc-serialize v0.3.15
   Compiling unicase v0.1.0
error[E0642]: patterns aren't allowed in methods without bodies
   --> /Users/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.15/src/serialize.rs:145:45
    |
145 |                                             &f_name: &str,
    |                                             ^^^^^^^

   Compiling byteorder v0.3.10
   Compiling traitobject v0.0.1
   Compiling httparse v0.1.4
error[E0277]: the size for values of type `Self` cannot be known at compilation time
   --> /Users/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.15/src/serialize.rs:201:5
    |
201 |     fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `Self`
    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
    = help: consider adding a `where Self: std::marker::Sized` bound
    = note: required by `std::result::Result`

   Compiling typeable v0.1.2
error: aborting due to 2 previous errors

Some errors occurred: E0277, E0642.
For more information about an error, try `rustc --explain E0277`.
   Compiling rand v0.3.8
error: Could not compile `rustc-serialize`.
warning: build failed, waiting for other jobs to finish...
error[E0277]: the size for values of type `Self` cannot be known at compilation time
  --> /Users/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.8/src/distributions/range.rs:83:5
   |
83 |     fn construct_range(low: Self, high: Self) -> Range<Self>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `Self`
   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
   = help: consider adding a `where Self: std::marker::Sized` bound
note: required by `distributions::range::Range`
  --> /Users/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.8/src/distributions/range.rs:50:1
   |
50 | pub struct Range<X> {
   | ^^^^^^^^^^^^^^^^^^^

error[E0277]: the size for values of type `Self` cannot be known at compilation time
  --> /Users/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.8/src/distributions/range.rs:87:5
   |
87 |     fn sample_range<R: Rng>(r: &Range<Self>, rng: &mut R) -> Self;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `Self`
   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
   = help: consider adding a `where Self: std::marker::Sized` bound
note: required by `distributions::range::Range`
  --> /Users/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.3.8/src/distributions/range.rs:50:1
   |
50 | pub struct Range<X> {
   | ^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `rand`.

To learn more, run the command again with --verbose.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.