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 (
To install WebTorrent:
npm install webtorrent-hybrid
To install a
webtorrent-hybrid command line program, run:
npm install webtorrent-hybrid -g
On OS X, this should Just Work™.
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
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
sudo yum install xorg-x11-server-Xvfb
webtorrent-hybrid has the same command line interface (CLI) and module API as
See the WebTorrent docs.