kpe / data-channel-pipe

Using shell pipes for streaming data to your web app over WebRTC Datachannel (based on the awesome rawrtc)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

To Build

Build dependencies in a local prefix under ./build/prefix

./make-dependencies.sh

Add the custom prefix to pkg-config search PATH

export PKG_CONFIG_PATH=${PWD}/build/prefix/lib/pkgconfig
export LD_LIBRARY_PATH=${PWD}/build/prefix/lib

Now build with CMake 3.2+

cd build
cmake -DCMAKE_INSTALL_PREFIX=${PWD}/prefix ..
make install

Signaling Server

To start it

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
python signaliing-server.py

To run the unit tests (for the signaling server)

npm install mocha chai

and open the unit-tests.html in a browser.

How to use the data channel pipe

To pipe the stdout and stdion over a WebRTC DataChannel, you could use the above signaling server for establishing a peer connection between you WebRTC client and a running instance of the rawrtc-data-channel binary built in the previous step:

  1. start the signaling server

  2. start the pipe process (passing the WS address of the signalling server)

    ./build/prefix/bin/rawrtc-datachannel-pipe ws://127.0.0.1:9765/test

  3. in your client establish a second WS connection to the signalling server, and use it to establish an WebRTC PeerConnection with the just started console application.

    python signaling-server.py

About

Using shell pipes for streaming data to your web app over WebRTC Datachannel (based on the awesome rawrtc)

License:BSD 2-Clause "Simplified" License


Languages

Language:C 84.9%Language:Python 8.7%Language:CMake 2.4%Language:Shell 2.1%Language:JavaScript 1.4%Language:HTML 0.5%