Giter VIP home page Giter VIP logo

node-webrtc's Introduction

    

NPM macOS/Linux Build Status Windows Build status

node-webrtc provides Node.js bindings to WebRTC M73. You can write Node.js applications that use RTCDataChannels with it. Some MediaStream APIs are supported. For examples, see node-webrtc-examples.

x86 x64 armv6l armv7l arm64
Linux   -   ✔︎   ✘   ✔︎ ✔︎
macOS   -   ✔︎   -   - -
Windows ✘   ✔︎   -   - -

Getting Started

Prerequisites

This library will attempt to download pre-compiled binaries for your particular platform using node-pre-gyp; however, if binaries are unavailable, it will fallback to building from source using node-cmake. When building from source, in addition to the prerequisites required by node-cmake, you will need

Install

The easiest way to install is via npm:

npm install wrtc

If you want to work from source, run

git clone https://github.com/js-platform/node-webrtc.git
cd node-webrtc
npm install

Depending on what you checkout, npm install will either download a pre-compiled binary or attempt to build from source. Set SKIP_DOWNLOAD=true to always build from source. See below for more information on building from source.

Build

If you would like to build node-webrtc from source, run

./node_modules/.bin/ncmake rebuild

You can pass either --debug or --release to build a debug or release build of node-webrtc (and the underlying WebRTC library). Refer to node-cmake for additional command-line options to ncmake.

Other Notes

Linux

On Linux, we statically link libc++ and libc++abi. Also, although we compile WebRTC sources with Clang (downloaded as part of WebRTC's build process), we compile node-webrtc sources with GCC 5.4 or newer.

armv7l

In order to cross-compile for armv7l on Linux,

  1. Set TARGET_ARCH to "arm".
  2. Install the appropriate toolchain, and set ARM_TOOLS_PATH.
  3. On Ubuntu, you may also need g++-arm-linux-gnueabihf.
wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabihf/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz
tar xf gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz
SKIP_DOWNLOAD=true TARGET_ARCH=arm ARM_TOOLS_PATH=$(pwd)/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf npm install
arm64

In order to cross-compile for arm64 on Linux,

  1. Set TARGET_ARCH to "arm64".
  2. Install the appropriate toolchain, and set ARM_TOOLS_PATH.
  3. On Ubuntu, you may also need g++-aarch64-linux-gnu.
wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
SKIP_DOWNLOAD=true TARGET_ARCH=arm64 ARM_TOOLS_PATH=$(pwd)/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu npm install

macOS

On macOS, we compile WebRTC sources with the version of Clang downloaded as part of WebRTC's build process, but we compile node-webrtc sources using the system Clang.

Windows

On Windows, we do not compile WebRTC sources with Clang. This is disabled by passing is_clang=false to gn gen.

Tests

Unit & Integration Tests

Once everything is built, run

npm test

Web Platform Tests

web-platform-tests/wpt defines a suite of WebRTC tests. node-webrtc borrows a technique from jsdom/jsdom to run these tests in Node.js. Run the tests with

npm run wpt:test

Browser Tests

These tests are run by Circle CI to ensure node-webrtc remains compatible with the latest versions of Chrome and Firefox.

npm run test:browsers

node-webrtc's People

Contributors

anumat avatar caseywebdev avatar d1plo1d avatar damonoehlman avatar davidburhans avatar dreaded-gnu avatar ekr avatar guymguym avatar helloiampau avatar janza avatar jonathanfrawley avatar kkoopa avatar kofd avatar manuguerra avatar manur avatar markandrus avatar murat-dogan avatar nazar-pc avatar oklas avatar olalonde avatar paul-maxime avatar piranna avatar rationalcoding avatar rosskukulinski avatar sebas642 avatar taylorhoward92 avatar thanpolas avatar williamberman avatar wouldgo avatar zsmweb avatar

Watchers

 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.