Skip to content

Added unknown source frame handler #32

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

Closed
wants to merge 3 commits into from

Conversation

mateusz28
Copy link

I'm using gortsplib in a scenario where the server is running inside a docker container. After RTSP negotiation UDP frames are coming from random ports so they are dropped in serverUDPListener run(). I have no control over the docker service so I can't turn off the userland-proxy option or use host networking in docker. I've managed to create a simple UDP matching mechanism based on NAT hole punching on the client-side and expecting new connections on the server side. Parsing RTP/RTCP frames I'm able to predict from which client/publisher the frame is coming from and modify SettupedTrack udp ports.
The problem is that currently, I need to modify serverudpl.go to inject this mechanism. If the library would have a built-in handler for frames coming from an unknown source it would be possible to make it from the connection handling layer.

@aler9
Copy link
Member

aler9 commented May 10, 2021

Hello, thanks for the contribution, the proposal is good, you just need to fix a couple of things:

  • format the code in order to make the "lint" workflow pass
  • rename OnUnknownClient into OnUnverifiedFrame
  • error handling is useless, since errors in this case don't go anywhere; remove the return variable from OnUnverifiedFrame()

@codecov-commenter
Copy link

Codecov Report

Merging #32 (e76b767) into main (4beda10) will decrease coverage by 0.07%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #32      +/-   ##
==========================================
- Coverage   74.78%   74.71%   -0.08%     
==========================================
  Files          37       37              
  Lines        3903     3927      +24     
==========================================
+ Hits         2919     2934      +15     
- Misses        710      718       +8     
- Partials      274      275       +1     
Impacted Files Coverage Δ
serverudpl.go 81.81% <16.66%> (-10.39%) ⬇️
serverconn.go 94.46% <0.00%> (-0.23%) ⬇️
serversession.go 77.41% <0.00%> (+0.33%) ⬆️
clientconnread.go 76.71% <0.00%> (+1.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4beda10...e76b767. Read the comment docs.

@aler9
Copy link
Member

aler9 commented Nov 22, 2021

please rebase and reopen if you still need this feature.

@aler9 aler9 closed this Nov 22, 2021
@github-actions
Copy link

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2022
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.

3 participants