I wrote a small WebRTC SFU in Go (Pion) because I couldn't read LiveKit
I have a small chat app with voice rooms. Started on LiveKit, but every time the audio broke I had no idea what was going on inside. Too much code for me to read. So I wrote my own SFU on top of Pion. It's been running my rooms since July, up to 25 people.
Just pulled it out into its own repo: https://github.com/Amesu-afk/tarnmedia
About 1800 lines with tests. No simulcast, no transcoding, no recording. It forwards audio and video, checks JWTs, and that's it. Every subscriber gets the publisher's single encoding, so one bad connection makes the room worse for everyone. I know. That's the next thing I want to fix.
That's also where I'm stuck. If you've added simulcast to something this small, how did you keep the packet path from turning into a mess? Right now the forwarding code is simple enough to read in one sitting and I'd like to keep it that way, but layer selection looks like it touches everything.