Running our SFU
Since you have some dependencies such as GCC, FFMPEG, libsrt, its easier to run it using docker.
# Build the image
docker build -t sfu .
# Create and start a container
docker run -d -p 5000:5000 -p 1935:1935 -p 7000:7000 -p 50051:50051 sfu
# With whip
docker run --rm -p 5000:5000 -p 1935:1935 -p 7000:7000 -p 50051:50051 -p 8989:8989 -p 5000-5200:5000-5200/udp sfu
# Check that its running
docker container ps -aWhen running in Docker you are using a NAT, so you have to configure things further, just to make it work locally you can add this:
You can then run the example located in examples/publish-webrtc go run main.go
Testing with Galene
Endpoint: http://localhost:8443/group/test/
Running from WSL2
- Install go
- Download it:
curl -OL https://go.dev/dl/go1.19.linux-amd64.tar.gz - Install it
sudo tar -C /usr/local -xvf go1.19.linux-amd64.tar.gz - Add it to the path
sudo nano ~/.profile, addexport PATH=$PATH:/usr/local/go/binat the end, save and close and refreshsource ~/.profile - Test
go version
- Download it:
- Install dependencies for our project
sudo apt install ffmpeg gcc musl libavfilter-dev libavdevice-dev libavformat-dev libavcodec-dev - Build SRT manually:
- Install deps
sudo apt-get install make tclsh pkg-config cmake libssl-dev build-essential - Clone the repo
git clone https://github.com/Haivision/srt.git - Build and install
./configurethenmake install, with that it’ll be added to the path. - You might need to add
export LD_LIBRARY_PATH=/usr/local/lib/to the path.
- Install deps
- You can run the project
go run cmd/main.go
If you need to find whats the IP from outside wsl, type this in pshell:
wsl -- ip -o -4 -json addr list eth0 `
| ConvertFrom-Json `
| %{ $_.addr_info.local } `
| ?{ $_ }