com.unity.webrtc icon indicating copy to clipboard operation
com.unity.webrtc copied to clipboard

[Question] Limit WebRTC port range?

Open robertgroh opened this issue 4 years ago • 8 comments

Is it possible to limit the port ranges used for WebRTC connections? I see, that for UDP connection ports above 60000 and for TCP port in the 54000ish range.

Is there a known default range for UDP or TCP? Also, can I configure a limited port range?

robertgroh avatar Apr 22 '20 14:04 robertgroh

I guess the limitation of the port range should be controlled by the firewall rule.

example : GCP https://cloud.google.com/vpc/docs/firewalls

karasusan avatar Apr 24 '20 03:04 karasusan

Hi @karasusan, thank you for your reply.

I guess I can limit the ports, which will be functioning (and returned as SERVER CANDIDATES from the STUN service) via blocks by firewall rules, but I want to know the port ranges, which will be tried in the first place.

Maybe this question is better located at https://github.com/Unity-Technologies/UnityRenderStreaming, what do you think?

robertgroh avatar Apr 24 '20 12:04 robertgroh

The same question is posted on Unity forum. https://forum.unity.com/threads/unity-webrtc-restrict-datachannel-ports.1025188/

karasusan avatar Dec 22 '20 01:12 karasusan

https://github.com/juju812/com.unity.webrtc/commit/3ef0c0e9d0f8d21f35cf060ecada156d68157914

Hi, @karasusan , here's one snippet implemented the port range feature.

But currently the port range is hard coded in Context class (which is enough for my temporary use), the port range configuration need to be exposed.

juju812 avatar Jun 30 '21 08:06 juju812

@juju812 I am checking it. Thanks.

karasusan avatar Jun 30 '21 10:06 karasusan

Hi @karasusan

Do you have any schedule to integrate the port range feature? If not, maybe I can follow current configuration tamplate and complete my code. Then I'll create a PR after implement finished.

juju812 avatar Jul 02 '21 08:07 juju812

@juju812 Thanks. I am sorry but the schedule of the feature will be a long time later.

karasusan avatar Jul 05 '21 08:07 karasusan

memo: WRS-238

kannan-xiao4 avatar Feb 22 '22 03:02 kannan-xiao4