Skip to content


Subversion checkout URL

You can clone with
Download ZIP
WebRTC stack for node.js
C++ JavaScript Python C HTML
Latest commit 77000f9 @modeswitch modeswitch Merge pull request #237 from caseywebdev/node-5
Add Node 5.x to CI


Build Status Gratipay


This open-source project provides a native module for NodeJS that supports a subset of standards-compliant WebRTC features. Specifically, the PeerConnection and DataChannel APIs.

MediaStream APIs are not supported in order to reduce the number of external dependencies and to make compilation faster and easier. In the future, support for MediaStreams may be added by proxying them over DataChannels. See #156 for more details and discussion.

This project relies on a companion library, libwebrtc.


The best way to get started is to read through the Getting Started and Example sections before having a look through the open issues. Some of the issues are marked as good first bug, but feel free to contribute to any of the issues there, or open a new one if the thing you want to work on isn't there yet.

Once you've done some hacking and you'd like to have your work merged, you'll need to make a pull request. If your patch includes code, make sure to check that all the unit tests pass, including any new tests you wrote. Finally, make sure you add yourself to the AUTHORS file.

Whenever possible, prefer making pull requests to opening issues.

Disclaimer Regarding Bounties

Some open issues have bounties assocaited with them. Once you patch is merged, you will need to coordinate with the person who posted the bounty in order to claim it.

Getting Started


  • python2
  • git
  • pkg-config
  • libncurses-devel
  • libssl-devel
  • libnss-devel
  • libexpat-devel


To install prerequisites with the apt-get package manager,

apt-get install python2.7 git-all pkg-config libncurses5-dev libssl-dev libnss3-dev libexpat-dev


To install prerequisites with the yum package manager,

yum install python git pkgconfig openssl-devel ncurses-devel nss-devel expat-devel


  • XCode

To install prerequisites using the homebrew package manager,

brew update
brew install git openssl pkg-config openssl homebrew/dupes/ncurses nss expat

Some of these libraries may be installed by default. Package names for these libraries may differ between distributions.


The easiest way to install is via npm:

npm install wrtc

If you want to work from source:

git clone
cd node-webrtc
npm install


Error while loading on Linux

Add a symlink to libncurses:

    sudo ln -s /usr/lib/ /usr/lib/

Some linux distros default to Python3 and the build process fails

This is most common on Arch Linux. Set python2 as the default for npm:

    npm config set python python2

The node.js package for my distro is too old

Follow the instructions here:


Unit tests

Once everything is built, try npm test as a sanity check.


You can run the data channel demo by node examples/bridge.js and browsing to examples/peer.html in chrome --enable-data-channels.


node examples/bridge.js [-h <host>] [-p <port>] [-ws <ws port>]


-h  host IP for the webserver that will serve the static files (default
-p  host port for the webserver that will serve the static files (default 8080)
-ws port of the Web Socket server (default 9001)

If the bridge and peer are on different machines, you can pass the bridge address to the peer by:


By default the bridge will be the same IP as the webserver and will listen on port 9001.


The ping-pong example creates two peer connections and sends some data between them.


node examples/ping-pong-test.js
Something went wrong with that request. Please try again.