Skip to content

Relay ICE server and ETag headers from the SFU in the WHIP proxy - #470

Open
cnderrauber wants to merge 2 commits into
mainfrom
whip-proxy-relay-ice-servers
Open

Relay ICE server and ETag headers from the SFU in the WHIP proxy#470
cnderrauber wants to merge 2 commits into
mainfrom
whip-proxy-relay-ice-servers

Conversation

@cnderrauber

Copy link
Copy Markdown
Contributor

The proxied WHIP handler only kept the SDP answer and the Location header from the SFU response, dropping the rest. Two consequences:

  • The ICE server advertisement (Link: rel="ice-server", RFC 9725 section 4.6) never reached the publisher, so a WHIP publisher had no way to learn TURN credentials and could not use a relay candidate.
  • The ETag was replaced with a checksum of the offer, while the SFU validates If-Match on PATCH against the ICE ufrag it sent, so ICE trickle over the proxy could not match.

Init now returns a WHIPInitResponse carrying the Link headers and the ETag alongside the answer, and both are relayed to the publisher. The native handler supplies neither, so it keeps the checksum ETag and sends no Link header. Link is added to Access-Control-Expose-Headers so browser publishers can read it.

Fixes #459

The proxied WHIP handler only kept the SDP answer and the Location header
from the SFU response, dropping the rest. Two consequences:

- The ICE server advertisement (Link: rel="ice-server", RFC 9725 section
  4.6) never reached the publisher, so a WHIP publisher had no way to
  learn TURN credentials and could not use a relay candidate.
- The ETag was replaced with a checksum of the offer, while the SFU
  validates If-Match on PATCH against the ICE ufrag it sent, so ICE
  trickle over the proxy could not match.

Init now returns a WHIPInitResponse carrying the Link headers and the
ETag alongside the answer, and both are relayed to the publisher. The
native handler supplies neither, so it keeps the checksum ETag and sends
no Link header. Link is added to Access-Control-Expose-Headers so browser
publishers can read it.

Fixes #459

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

ETag is not a CORS-safelisted response header, so a browser publisher
cannot read it and cannot echo it as If-Match on the ICE trickle PATCH.
Add it to Access-Control-Expose-Headers on the session creation response
and on the PATCH response, which returns an ETag as well.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WHIP: Advertise ICE servers to publishers via Link: rel="ice-server" (RFC 9725 §4.6)

4 participants