Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webrtc: expose the location header #2453

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

rgl
Copy link
Contributor

@rgl rgl commented Oct 3, 2023

The suggested WHEP reference client is not able to access the Location header at:

https://github.com/medooze/whip-whep-js/blob/v1.0.3/whep.js#L86-L87

This PR allows the browser to expose that header to the javascript code.

PS: It also needs to use the DELETE method. should I add it to this PR too? or another PR?

Though, this is still not enough to get that client working, as it fails with:

2023/10/03 20:52:30 DEB [WebRTC] [conn [::1]:44266] PATCH /camera_sub/whep
2023/10/03 20:52:30 DEB [WebRTC] [conn [::1]:44266] [c->s] PATCH /camera_sub/whep HTTP/1.1
Host: localhost:8889
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,pt-PT;q=0.8,pt;q=0.7
Connection: keep-alive
Content-Length: 105
Content-Type: application/trickle-ice-sdpfrag
Origin: http://localhost:8080
Referer: http://localhost:8080/
Sec-Ch-Ua: "Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Linux"
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

a=ice-ufrag:w08e
a=ice-pwd:6j8Xfsi7cdr8nYnyvEuoT/vT
m=video 9 RTP/AVP 0
a=mid:0
a=end-of-candidates

2023/10/03 20:52:30 DEB [WebRTC] [conn [::1]:44266] [s->c] HTTP/1.1 400 Bad Request
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Server: mediamtx


2023/10/03 20:52:36 DEB [WebRTC] [session 3c3ca543] peer connection state: disconnected
2023/10/03 20:52:36 DEB [WebRTC] [session 3c3ca543] peer connection state: closed
2023/10/03 20:52:36 INF [WebRTC] [session 3c3ca543] closed: peer connection closed

Should I open an new issue in this repository for that problem (and full test application and error)?

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #2453 (93b2f3b) into main (4ba2dc1) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2453      +/-   ##
==========================================
- Coverage   61.89%   61.85%   -0.04%     
==========================================
  Files         129      129              
  Lines       14540    14540              
==========================================
- Hits         8999     8994       -5     
- Misses       4872     4876       +4     
- Partials      669      670       +1     
Files Coverage Δ
internal/core/webrtc_http_server.go 57.74% <100.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aler9 aler9 merged commit 215f88e into bluenviron:main Oct 4, 2023
@aler9
Copy link
Member

aler9 commented Oct 4, 2023

Thanks for providing this PR and for testing the server against the reference WHIP JS implementation. You can either open an issue, or even better, provide PRs to fix compatibility with PATCH and DELETE.

@aler9
Copy link
Member

aler9 commented Oct 15, 2023

added in v1.2.0

@rgl rgl deleted the whep-expose-location-header branch October 15, 2023 10:51
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants