ice icon indicating copy to clipboard operation
ice copied to clipboard

MapPortHandler Callback for container support

Open xinze-zheng opened this issue 2 months ago • 3 comments

Description

Expose a handler func(candidate Candidate) int handler that will be called upon addCandidate. The handler will set the mappedPort private field. During unmarshal, if mappedPort is not 0, it will replace the port in ICE candidate string.

Reference issue

https://github.com/pion/webrtc/issues/3155

xinze-zheng avatar Nov 08 '25 22:11 xinze-zheng

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 87.01%. Comparing base (e1b445c) to head (460350f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #831      +/-   ##
==========================================
- Coverage   87.27%   87.01%   -0.27%     
==========================================
  Files          43       43              
  Lines        4819     4836      +17     
==========================================
+ Hits         4206     4208       +2     
- Misses        438      453      +15     
  Partials      175      175              
Flag Coverage Δ
go 87.01% <100.00%> (-0.27%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 08 '25 22:11 codecov[bot]

@xinze-zheng I'm sorry about the internal API change, we had to fix the options so we can upgrade webrtc to use them.

JoTurk avatar Nov 09 '25 21:11 JoTurk

I think it would be better if we can change the test to use the new Public api instead, NewAgentWithOptions, so it doesn't break if we change the internal API in the future, and so it matches the user contract. But this is up to you.

JoTurk avatar Nov 09 '25 21:11 JoTurk