Add support for dynamic server-sent offers via 406 responses #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just as I did on the WHEP server, this PR implements support for the automatic fallback to server-sent offers when a server replies with a 406 instead of a 201. As such, this basically partially restores the behaviour the client had before #9 was merged, allowing the client to add in both modes depending on the answer from the server.
This patch is still a bit experimental as there are a couple of things that should have better cleanup (e.g., the original PeerConnection that was created for a client-sent offer and then replaced when switching to a server-sent offer is not removed until shutdown), but apart from this it should be functionally working. To test this with the Janus based web server, you'll need to use this branch. If your server supports server-sent offers as per v03 of the draft, this should work with that as well (please let me know if it doesn't).