Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md - github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aaac2d0f50fb6335d1050aa9335e9cda456763bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
webtorrent - BitTorrent over WebRTC
==========

A streaming torrent client in your browser, powered by webRTC and black magic.

**Watch / star repo to follow along with progress**

![Magic](https://raw.github.com/feross/webtorrent/master/img/logo.png)


## Planned Features

- **BitTorrent in your browser!**
- **No plugins** (uses WebRTC Data Channels for peer-to-peer data)
- **Streaming playback** (get first pieces first)
  - Into `video` tag with MediaSource API when possible
  - Flash player with JS bridge for other media types
- Works with .torrent files and magnet links
- Supports DHT (trackerless torrents) over WebRTC
  - Extensions to DHT protocol to work over WebRTC
  - DHT nodes do "peer introductions" so WebRTC can work without a centralized signaling server
- **Supports completely serverless, trackerless operation**


## Project Goal

Build a fully-interoperable web-based BitTorrent client that can be used without an install (no app/plugin/extension/etc.).

Since WebTorrent is web-first, it's dead simple for users to use without undertanding .torrent, magnet links, clients, etc. By making BitTorrent easier, it will be accessible to new swathes of users who were previously intimidated, confused, or unwilling to install a program on their machine to participate.


## Interoperability with BitTorrent

**Problem:** WebTorrent clients and normal BitTorrent clients cannot directly connect because WebRTC cannot open UDP/TCP sockets. This is a security restriction on WebRTC that is unlikely to change. So, how do we get content into the WebTorrent network?

**Best solution:** Mainstream BitTorrent clients add support for WebTorrent. Basically, normal clients implement WebRTC so that WebTorrent clients can directly connect to them. (This could happen once WebTorrent has a lot of users.)

**Good solution:** Users who want to download torrents that aren't yet seeded by any WebTorrent users need to install a "hybrid client" that implements WebTorrent **and** BitTorrent. This can be implemented as a Chrome/Firefox App/Extension that bridges the two networks like this:

  - Hybrid clients can seed+leech from **both** WebTorrent and BitTorrent users.
  - Hybrid clients are DHT nodes in **both** the WebTorrent and BitTorrent DHTs.
  - The first time a hybrid client downloads a torrent that no other WebTorrent clients are seeding, they become the first WebTorrent seeder. (They essentially "bring" the file into the WebTorrent network).
  - Important note: Hybrid clients **never** download torrents on behalf of other users. That would be a terrible idea.
  - Until BitTorrent clients support WebTorrent, "pure" **WebTorrent clients can only download from other WebTorrent clients.**


## WebTorrent vs BitTorrent

- WebTorrent is slower at finding peers since "DHT over WebRTC" requires multiple roundtrips for peer introductions. (This is a requirement of WebRTC signaling - no way around this)
- WebTorrent peers must keep their browser tab open to seed (Show UI to encourage seeding back at least 2x)
- Slower piece verification (SHA1) (max 2MB/s with web worker pool, Web Crpyto API will bring huge speed-up when it's finally ready)
- WebTorrent bootstrap DHT node does *a bit* more work than a BitTorrent one since it must do WebRTC signaling. (Not a huge deal)


## Planned NPM modules

- [webtorrent](https://github.com/feross/webtorrent) (this repo)
- [magnet-uri](https://github.com/feross/magnet-uri)
- webtorrent-chrome
- webtorrent-protocol
- webtorrent-dht
- webtorrent-bootstrap
- webworker-pool
- webtorrent-verifier
- sdp-compress


## Todo for basic working version

- Build bittorrent client as Chrome App (connects to normal BT network)
  - ~~Use UDP/TCP APIs~~
  - ~~Support DHT~~
  - Support magnet links (fetching .torrent from network)
  - Support peer write protocol
  - Support large file saving (FileSystem API?)
- Make WebRTC data channel work on the server
- DHT over WebRTC (add new method for peer introduction)
  - Use bootstrap server for initial introduction
  - POST endpoint for sending offer/getting answer
- Storage?
- Streaming video
  - MediaSource into `video` tag
  - Flash player for other media types
- Easy torrent creation

## Todo eventually

- UPnP or NAT-PMP (so the hybrid client can get listed in peers' routing tables)

## Introduction to WebRTC Data and WebTorrent

[Watch the talk](https://vimeo.com/77265280) from *RealtimeConf* on Vimeo (skip to end for stuff about WebTorrent):

[![webrtc talk](https://raw.github.com/feross/webtorrent/master/img/webrtc-talk.png)](https://vimeo.com/77265280)


## Useful Links

- [BitTorrent Spec](https://wiki.theory.org/BitTorrentSpecification)

### DHT

- [DHT Protocol](http://www.bittorrent.org/beps/bep_0005.html)
- [Kademlia Paper](http://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf)
- [Main DHT implementation](https://github.com/jech/dht)
- [Optimized DHT bootstrap implementation](https://github.com/jech/dht-bootstrap)


## Authors

- [Feross Aboukhadijeh](http://feross.org)
- John Hiesey


## Contributors

- *Contributions welcome! Add yourself here when you send a pull request.*


## License

MIT