GithubHelp home page GithubHelp logo

tempbottle / node-webrtc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from node-webrtc/node-webrtc

0.0 1.0 0.0 562 KB

WebRTC stack for node.js

Home Page: js-platform.github.io/node-webrtc

License: BSD 2-Clause "Simplified" License

JavaScript 38.92% Python 3.07% HTML 0.15% C++ 55.92% C 1.93%

node-webrtc's Introduction

NPM

Build Status Gratipay

Contributing

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.

Getting Started

Prerequisites

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

Debian/Ubuntu

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

CentOS/Fedora/RHEL

To install prerequisites with the yum package manager,

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

OSX

  • XCode

To install prerequisites using the homebrew package manager,

brew update
brew install git openssl pkg-config openssl ncurses nss expat

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

Install

The easiest way to install is via npm:

npm install wrtc

If you want to work from source:

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

Troubleshooting

Error while loading libtinfo.so.5 on Linux

Add a symlink to libncurses:

    sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5

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: https://github.com/joyent/node/wiki/installing-node.js-via-package-manager

Tests

Unit tests

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

bridge.js

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

usage:

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

options:

-h  host IP for the webserver that will serve the static files (default 127.0.0.1)
-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:

http://<webserver>/peer.html?<sockertserver:port>

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

ping-pong-test.js

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

usage:

node examples/ping-pong-test.js

node-webrtc's People

Contributors

anumat avatar blakelapierre avatar cjb avatar damonoehlman avatar davidburhans avatar ekr avatar helloiampau avatar juniordiscart avatar kkoopa avatar kofd avatar manur avatar markandrus avatar piranna avatar thanpolas avatar wouldgo 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.