Giter VIP home page Giter VIP logo

webtorrent's Introduction

WebTorrent

WebTorrent - Streaming BitTorrent client for the browser

Build Status Dependency Status Gittip

Warning: This is pre-alpha software. Nothing works yet. Watch/star to follow along with progress.

Support development

Donate BitCoins Send Bitcoins to: 1B6aystcqu8fd6ejzpmMFMPRqH9b86iiwh

Project Goal

Build a browser BitTorrent client that requires no install (no plugin/extension/etc.) and fully-interoperates with the regular BitTorrent network. Use WebRTC Data Channels for peer-to-peer transport.

Since WebTorrent is web-first, it's simple for users who do not understand .torrent files, magnet links, NATs, 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.

NPM Modules

Most of the active development is happening inside of smaller npm modules which will be used by WebTorrent. These are the modules we are writing to make WebTorrent work:

The Node Way™

"When applications are done well, they are just the really application-specific, brackish residue that can't be so easily abstracted away. All the nice, reusable components sublimate away onto github and npm where everybody can collaborate to advance the commons." — substack from "how I write modules"

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

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 Crypto 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)

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 wire 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

Todo eventually

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

Introduction to WebRTC Data and WebTorrent

Watch the talk from RealtimeConf on Vimeo (skip to end for stuff about WebTorrent):

webrtc talk

Useful Links

Authors

Contributors

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

License

MIT

Magic

webtorrent's People

Contributors

feross avatar jhiesey avatar mattburesh avatar

Watchers

 avatar  avatar

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.