Code Monkey home page Code Monkey logo

webtorrent-hybrid's Introduction

WebTorrent (with WebRTC support in Node.js)

Build Status NPM Version NPM Downloads

Streaming torrent client for node environments

In node.js, the webtorrent package only connects to normal TCP/UDP peers, not WebRTC peers. If you want to connect to all types of peers, including WebRTC peers, from node.js, you need to use this package (webtorrent-hybrid).

Previous versions (0.x) of this package used wrtc, a WebRTC implementation via native extensions, the current one is based on electron-webrtc (which in turn uses electron-prebuilt) for better compatibility. It creates a hidden Electron process (which is based on Chromium, so WebRTC support is great!) and communicates with that process to enable WebRTC in Node.js. This adds a lot of overhead, so we are looking forward to using a pure JavaScript implementation, like perhaps Node-RTCPeerConnection when it's ready.

To run this package on a headless server execute the provided script or follow these instructions.

js-standard-style

Install

To install WebTorrent:

npm install webtorrent-hybrid

To install a webtorrent-hybrid command line program, run:

npm install webtorrent-hybrid -g

OS X

On OS X, this should Just Work™.

Linux

The current version of webtorrent-hybrid requires a screen, since the headless Electron instance expects one. If you're running in a screenless environment (like on a server), you must use a virtual screen such as xvfb. You must install it before using webtorrent-hybrid.

For Debian / Ubuntu:

sudo apt-get install xvfb

If you get an error about a missing .so file ("error while loading shared libraries"), use the search at the bottom of packages.debian.org to find out which packages in your release provide a given file.

On server editions, the following additional packages should be installed since Electron depends on them:

sudo apt-get install libgtk2.0-0 libxtst-dev libxss-dev libgconf2-dev libnss3 libasound2-dev

For CentOS / RHEL:

sudo yum install xorg-x11-server-Xvfb

Usage

webtorrent-hybrid has the same command line interface (CLI) and module API as webtorrent. Just require('webtorrent-hybrid') instead of require('webtorrent').

See the WebTorrent docs.

License

MIT. Copyright (c) WebTorrent, LLC.

webtorrent-hybrid's People

Contributors

feross avatar autarc avatar stiveknx avatar greenkeeperio-bot avatar diegorbaquero avatar mappum avatar rom1504 avatar

Watchers

Jamie Nichols 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.