Equivalent of `webrtc/candidate` with HTTP API
I'm writing my own frontend around go2rtc, I do not expose anything besides 8555 port directly to the internet, I wrap the API calls with my server, which authenticates the users, etc. I only want to use WebRTC.
The only problem I'm having is that I do not want to use websockets. With HTTP I can access POST /api/webrtc?src={src} to exchange offer/answer sdp, but I need to do the same for ICE candidates, like you do here: https://github.com/AlexxIT/go2rtc/blob/master/www/video-rtc.js#L496
The problem is I don't see a http endpoint to do so.
Am I blind again? Is there a workaround? Or can you provide such an endpoint?
Thanks!
- This is wrong repo for your question.
- There is an example of a synchronous API https://github.com/AlexxIT/go2rtc/blob/master/www/webrtc-sync.html
Sorry for posting in the wrong place, I was searching for a solution and I mixed the tabs I think.
Anyway - waiting for ICE gathering works, thanks, but it's less "realtime", do you think having HTTP API for that would be possible?
In theory, the WHEP/WHIP standards meant that candidates were exchanged via a PATCH request. I was just too lazy to implement it.
https://github.com/AlexxIT/go2rtc/blob/ae8145f26696ffc19a13fea4a21b4a5306fc0e3a/internal/webrtc/server.go#L37-L39
Now it's time to look into what has changed in the world of WebRTC standards since then. As far as I know, they have been changed. Haven't looked into this issue though.