This is a fork from 'facebookexperimental/go-media-webtransport-server' and 'facebookexperimental/webcodecs-capture-play'
to put them in one repository and make the client (webcodecs-capture-play) run using Gin with the certificates.
Moreover, I replaced Go compiler from 1.18 to 1.21, to replace the WebTransport's package
from "github.com/adriancable/webtransport-go" to "github.com/quic-go/webtransport-go".
Also, updated the scripts to generate certificates from mkcert.
This way I can study the code without running browser with specific arguments and I will be able to test it from firefox.
Unfortunately, current version of Firefox does not support MediaStreamTrackProcessor.
Install go 1.21 to compile
Install mkcert from https://github.com/FiloSottile/mkcert
And run
go mod tidy
bash scripts/create-server-certs.sh
go build -o client/client ./client/main.go
go build -o server/server ./server/main.go
First increase the UDP buffer size for WebTransport to work
sudo sysctl -w net.core.rmem_max=2500000
sudo sysctl -w net.core.wmem_max=2500000
Open a terminal and run the server
cd server
./server
Open another terminal and run the client
cd client
./client
Open Google's Chrome and two tabs
The first tab visit https://localhost:8080/encoder
The second tab visit https://localhost:8080/player
Copy the StreamID from the first tab to the second tab
Press start from the first tab (allow camera) and then on the second tab and you will start seeing the feed from the first tab going to the second tab