Merging gst-examples
[platform/upstream/gstreamer.git] / subprojects / gst-examples / webrtc / signalling / README.md
1 ## Overview
2
3 Read Protocol.md
4
5 ## Dependencies
6
7 * Python 3
8 * pip3 install --user websockets
9
10 ## Example usage
11
12 For dev usage, generate a self-signed certificate and run the server:
13
14 ```console
15 $ ./generate_cert.sh
16 $ ./simple_server.py
17 ```
18
19 If you want to use this server from the browser (to use the JS example, for
20 instance), you will need to go to `https://127.0.0.1:8443` and accept the
21 self-signed certificate. This step is not required if you will be deploying on
22 a server with a CA-signed certificate, in which case you should use
23 `./simple_server.py --cert-path <cert path>`.
24
25 ### Session Based
26
27 In two new consoles, run these two commands:
28
29 ```console
30 $ ./session-client.py
31 Our uid is 'ws-test-client-8f63b9'
32 ```
33
34 ```console
35 $ ./session-client.py --call ws-test-client-8f63b9
36 ```
37 ### Room Based
38
39 Or, if you want to test rooms, run these two in two new consoles:
40
41 ```console
42 $ ./room-client.py --room 123
43 Our uid is 'ws-test-client-bdb5b9'
44 Got ROOM_OK for room '123'
45 ```
46
47 ```console
48 $ ./room-client.py --room 123
49 Our uid is 'ws-test-client-78b59a'
50 Got ROOM_OK for room '123'
51 Sending offer to 'ws-test-client-bdb5b9'
52 Sent: ROOM_PEER_MSG ws-test-client-bdb5b9 {"sdp": "initial sdp"}
53 Got answer from 'ws-test-client-bdb5b9': {"sdp": "reply sdp"}
54 ```
55
56 You will see similar output with more clients in the same room.