meetecho / simple-whip-client

Simple WHIP Client (based on GStreamer's webrtcbin)
GNU General Public License v3.0
66 stars 18 forks source link

Add support for WHIP Link headers to autoconfigure STUN/TURN #5

Closed lminiero closed 2 years ago

lminiero commented 2 years ago

This is an attempt to address what's described in #4. As explained there, with GStreamer we can't add STUN/TURN servers after we've sent our offer, which means this code tries to do the same by using OPTIONS instead.

This feature is disabled by default: to tell the WHIP client to send the OPTIONS and get a list of STUN/TURN servers automatically, you need to pass the -f argument via command line. Notice that this will make the WHIP client ignore any other server you may have passed manually via -S and -T.

You can test this using the latest version of my WHIP server, which can be configured to return a list of STUN/TURN servers if you configure it accordingly (either statically in the configuration file, or per endpoint if you add them when creating a new one). I made a few tests and this seems to work as expected: of course more interop tests will need to be performed, as the code that processes the Link headers and turns them to addresses that can be used in GStreamer may be a bit flaky.

lminiero commented 2 years ago

Merging.