This is an extension of the SFU-Minimal code example from github.com/pion/webrtc.
In the original SFU-Minimal code example, the Publish
and Join
webpages are hosted on jsfiddle.net. We need to manually transfer the SDPs between the webpage and our server.
In this extension, we strive to build a signalling server and automate the exchange of SDPs between the webpages and the server. Moreover, the webpages Publish
and Join
are hosted on the same server as the signalling server.
Additionally, we try to remember the publisher and client so as to reconnect upon a loss of connection.
- Download the code using
git clone https://github.com/Adaickalavan/Go-WebRTC-GStreamer.git
- Ensure
GO111MODULE=on
in your terminal. - To run locally:
- Run
go install
in the project folder. - Then run the executable, i.e.,
Go-WebRTC-GStreamer
.
- Run
- To run the code in Docker, do the following:
- Run
docker build -t webrtc .
in the project folder. - Then run
docker-compose up
.
- Run
- Go to
localhost:8088/publish
web page which will start capturing video using your webcam. This video will be broadcast to multiple clients. - Then open another tab in your browser, and go to
localhost:8088/join
to see the broadcasted video.