AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
7.22k stars 518 forks source link

WHEP end point doesn't include location header #1315

Open toptensoftware opened 3 months ago

toptensoftware commented 3 months ago

I'm trying to use go2rtc with this WHEP client library:

https://github.com/medooze/whip-whep-js

It's failing because the response to the WHEP post returns 201 Created, but doesn't include a "location" header:

https://github.com/medooze/whip-whep-js/blob/main/whep.js#L99

According to this:

https://www.ietf.org/archive/id/draft-murillo-whep-03.html#name-protocol-operation

it should:

The WHEP Endpoint will generate an SDP answer and return a "201 Created" response with a content type of "application/sdp", the SDP answer as the body, and a Location header field pointing to the newly created resource.

I'm using http://localhost:1984/api/webrtc?src=stream_1 as the WHEP end-point.

Am I missing something? Is there some way I can work around this and deduce the location on the client side until this is fixed?

AlexxIT commented 3 months ago

You right. This should be improved.

toptensoftware commented 3 months ago

Thank you - look forward to it.