obs-webrtc: Add Link Header support
Description
WHIP/WHEP allows ICE Servers to be specified via Link Headers
Motivation and Context
Some WebRTC deployments are behind a NAT. Companies/developers place their TURN server on the edge, and use that to access the TURN servers.
I have had 3 companies reach out to me about this, so implemented it.
How Has This Been Tested?
Ran broadcast-box and only listened on 127.0.0.1 and confirmed that traffic could be routed through pion/turn
Types of changes
- New feature (non-breaking change which adds functionality)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.
I just tested this against OBS Studio and it seems to be working flawlessly.
@tt2468 Could I get a review of this one now please?
I have created a test application that confirms this is working. You can get it here https://github.com/Sean-Der/whip-turn-test
The only thing you need to change is the IP address of the host you are running the server on here
OBS without this patch running against this server behaves like this. It shows WHIP connected and starting pushing media.
Running WHIP server at http://localhost:8085
ICE Connection State has changed: checking
ICE Connection State has changed: connected
Getting incoming media audio/opus
Getting incoming media video/H264
Without this change the server prints the following. OBS doesn't have TURN support so is unable to connect
Running WHIP server at http://localhost:8085
ICE Connection State has changed: checking
Some users today who are using WHIP will see OBS unable to connect and have no idea why
Thank you so much @DDRBoxman @RytoEX I really appreciate the reviews :)
I'm noticing that this PR appears to be un-compilable on Ubuntu 22.04 due to the usage of CURLH_HEADER and Ubuntu's CURL version not having support. We have existing header parsing logic which was used to parse the Location header. I would say we will need to expand that existing logic instead of using CURLH_HEADER.
I will work on fixing this now @tt2468
Fixed with https://github.com/obsproject/obs-studio/pull/10786