gstreamer/webrtc/signalling
2021-03-16 19:41:27 +05:30
..
Dockerfile signalling: Fix simple-server script name in Dockerfile 2020-06-18 23:34:48 +10:00
generate_cert.sh webrtc: update for move to gst-examples 2020-06-25 18:36:22 +10:00
meson.build webrtc: update for move to gst-examples 2020-06-25 18:36:22 +10:00
Protocol.md webrtc: Document OFFER_REQUEST in the protocol doc 2021-02-10 16:21:32 +05:30
README.md webrtc/signalling: Document cert exception needed for browsers 2021-03-16 19:41:27 +05:30
room-client.py simple-server: Add support for multi-party rooms 2017-10-28 19:20:44 +05:30
session-client.py signalling/client.py: Rename to session-client.py 2017-10-28 19:00:03 +05:30
simple_server.py simple_server: asyncio TimeoutError has moved 2020-06-18 23:34:48 +10:00

Overview

Read Protocol.md

Dependencies

  • Python 3
  • pip3 install --user websockets

Example usage

For dev usage, generate a self-signed certificate and run the server:

$ ./generate_cert.sh
$ ./simple_server.py

If you want to use this server from the browser (to use the JS example, for instance), you will need to go to https://127.0.0.1:8443 and accept the self-signed certificate. This step is not required if you will be deploying on a server with a CA-signed certificate, in which case you should use ./simple_server.py --cert-path <cert path>.

Session Based

In two new consoles, run these two commands:

$ ./session-client.py
Our uid is 'ws-test-client-8f63b9'
$ ./session-client.py --call ws-test-client-8f63b9

Room Based

Or, if you want to test rooms, run these two in two new consoles:

$ ./room-client.py --room 123
Our uid is 'ws-test-client-bdb5b9'
Got ROOM_OK for room '123'
$ ./room-client.py --room 123
Our uid is 'ws-test-client-78b59a'
Got ROOM_OK for room '123'
Sending offer to 'ws-test-client-bdb5b9'
Sent: ROOM_PEER_MSG ws-test-client-bdb5b9 {"sdp": "initial sdp"}
Got answer from 'ws-test-client-bdb5b9': {"sdp": "reply sdp"}

You will see similar output with more clients in the same room.