This example shows how to use the HTTP Websocket as a signaling protocol for the inLive Hub. This example contains a static HTTP server to serve the basic HTML file as our WebRTC client. The client will connect through the HTTP WebSocket to exchange the SDP and ICE candidates.
This example is using a single room only. To support multiroom, you need to create an endpoint to create a new room and store the session on a map variable.
To run this example, follow the steps below:
- Run the HTTP server:
go run main.go
- Open the browser to open the client.
- Click the
Start
button to start the WebRTC connection. - Open another browser tab to start a different client.
- Click the
Start
button to start the WebRTC connection, you should see the video stream from the first client. - Repeat the steps above to add more clients.