rhubarb-lip-sync/rhubarb/lib/webrtc-8d2248ff/webrtc/tools/rtcbot/README

60 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2016-06-21 20:13:05 +00:00
=== RTCBot ===
RTCBot is a framework to write tests that need to spawn multiple webrtc
endpoints.
== Description ==
RTCBot is a framework that allows to write tests where logic runs on a single
host that controls multiple endpoints ("bots"). It allows creating complex
scenarios that would otherwise require non-trival signalling between multiple
parties.
The host runs in node.js, but the test code is run in an isolated context with
no access to node.js specifics other than the exposed api via a test variable.
Part of the exposed api (test.spawnBot) allows a test to spawn a bot and
access its exposed API. Details are in botmanager.js.
== How to run the test ==
$ cd trunk/webrtc/tool/rtcbot
$ npm install express browserify ws websocket-stream dnode
$ mkdir configurations
$ cd configurations
$ openssl genrsa -out priv.pem 1024
$ openssl req -x509 -new -key priv.pem -days 3650 -out cert.crt
$ cd trunk/webrtc/tool/rtcbot
$ node main.js "<test_name>"
* Note:
In first time you will use rtcBot you will receive a warning telling
you that your connection is not private. Just avoid this warning and
click Proceed to localhost (unsafe).
== How can I see the list of available tests? ==
$ node main.js
== Example on how to install nodejs ==
$ cd /work/tools/
$ git clone https://github.com/creationix/nvm.git
$ export NVM_DIR=/work/tools/nvm; source $NVM_DIR/nvm.sh
$ nvm install 0.10
$ nvm use 0.10
== Why generating the private key and self signed certificate? ==
- Private key and certificate are used for creating HTTPs server in
rtcBot for loading the required files on the different types of the bots.
== Supported Bot Types ==
- "chrome": chrome on host machine.
- "android-chrome": chrome on android device. Details in "Android" Section.
* Bot type is specified directly by the test.
== Android ==
Before running test with Android one MUST forward the device port 8080 to the
host machine. That is easy to achieve with chrome port forwarding tools.
- Visit chrome://inspect/devices on the host machine.
- Configure and enable port forwarding 8080 -> localhost:8080
- Open chrome on you Android device before running test, and leave it
running until the end of test.
- Run your test.