In the current configuration, plain UDP transports use the same port range configuration of WebRTC transports. In some scenario, it will be useful to select a different port range for plain UDP connections that are not using DTLS encryption in order to prevent man-in-the-middle attacks (using ad-hoc firewall configurations and/or other filtering techniques).
I’m digging into the code and the best way I found is modifying
RTC::PortManager and defining an additional
plain property and using two new configuration options (
Any comments/suggestions about this?
Here you can find a first experimental implementation: https://github.com/vpalmisano/mediasoup/commit/bcfb1f80b60a79ca24df94264018aea561af717b
plainMaxPort options can be set to
0 to use the same port range defined by
rtcMaxPort. Instead, in order to use a different port range,
plainMaxPort should be set to a different port range, not overlapping with