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) added support for ice mux tcp and nat1to1ips #1323

Merged
merged 16 commits into from
Dec 30, 2022

Conversation

andrew-ld
Copy link
Contributor

@andrew-ld andrew-ld commented Dec 22, 2022

With this pull request introduce the following features:

  • TCP mux configuration support for webrtc.
  • Support for configuring a set of fixed public ip instead of webwrtc automatic discovery.

Configuration will have some new parameters:

  • webrtcICETCPMuxEnable (boolean)
  • webrtcICETCPMuxAddress (string)
  • webrtcICEHostNAT1To1IPs (list of string)

Using webrtc ice tcp mux allows your software to work properly on network infrastructures (server side) where you have more stringent limitations, in our case we needed it to work through a single tcp port, for example.

We need NAT1To1IPs because the software runs inside a container where it is exposed to the internet via a virtual network interface, without specifying NAT1To1IPs to webrtc the candidate will get an invalid ip.

@dottgonzo
Copy link

dottgonzo commented Dec 24, 2022

please allow to use this server with this kind of features or it will be hard or impossible to use the webrtc streams with containerized environments. This features enable useful functionalities that are right now embedded in software like wowza.

@codecov-commenter
Copy link

codecov-commenter commented Dec 25, 2022

Codecov Report

Merging #1323 (0040f2b) into main (455b8be) will decrease coverage by 0.25%.
The diff coverage is 27.84%.

@@            Coverage Diff             @@
##             main    #1323      +/-   ##
==========================================
- Coverage   62.48%   62.23%   -0.26%     
==========================================
  Files         113      113              
  Lines       12020    12074      +54     
==========================================
+ Hits         7511     7514       +3     
- Misses       3915     3962      +47     
- Partials      594      598       +4     
Impacted Files Coverage Δ
internal/core/formatprocessor_h264.go 75.43% <ø> (ø)
internal/core/hls_muxer.go 54.30% <ø> (ø)
internal/core/rtmp_conn.go 63.40% <ø> (ø)
internal/core/rtmp_source.go 65.75% <ø> (-2.06%) ⬇️
internal/core/webrtc_conn.go 0.00% <0.00%> (ø)
internal/hls/client_processor_fmp4.go 65.89% <ø> (ø)
internal/hls/client_processor_mpegts.go 61.24% <ø> (ø)
internal/hls/fmp4/init.go 60.09% <ø> (ø)
internal/hls/fmp4/init_track.go 67.79% <ø> (ø)
internal/hls/mpegts/tracks.go 0.00% <ø> (ø)
... and 16 more

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

@andrew-ld
Copy link
Contributor Author

I applied codecov's suggestions, now it should be fine

@aler9
Copy link
Member

aler9 commented Dec 28, 2022

Hello,

  • add the new parameters to rtsp-simple-server.yml with a brief description
  • add the new parameters to apidocs/openapi.yaml
  • add the new parameters to closeWebrtcServer in core.go, otherwise hot reloading / API will not work
  • tcpMuxLn is not closed when webrtcServer is closed - you have to save it somewhere and close it after s.ln.Close()

thanks

@andrew-ld
Copy link
Contributor Author

@aler9 I should have done everything

@aler9 aler9 merged commit b27c363 into bluenviron:main Dec 30, 2022
@aler9
Copy link
Member

aler9 commented Dec 30, 2022

This has been merged with some changes, thanks for providing the code.

I'm interested too it in the possibility of running the server inside a container without --network=host, i'll add to the README a section that describes how to use these new parameters in order to achieve so.

Furthermore, i'll also dig into SetICEUDPMux(), and if it works, i'll add a parameter for that too.

@aler9
Copy link
Member

aler9 commented Jan 8, 2023

Added in v0.21.1

@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 2023
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.

None yet

4 participants