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

怎么限制RTCPeerConnection随机端口范围? #103

Open
ycn2022 opened this issue Sep 19, 2023 · 6 comments
Open

怎么限制RTCPeerConnection随机端口范围? #103

ycn2022 opened this issue Sep 19, 2023 · 6 comments

Comments

@ycn2022
Copy link

ycn2022 commented Sep 19, 2023

现在的端口看起来是随机的,需要开放防火墙的所有端口。请问怎么限制随机端口范围?

@ycn2022
Copy link
Author

ycn2022 commented Sep 20, 2023

现在发现还会用到50000-65535之间的随机tcp端口,防火墙如果没放开50000-65535的tcp端口就黑屏。请问这个怎么解决?

@g0415shenw
Copy link
Collaborator

UE方面目前没找到限制端口的方法。浏览器端有限制端口的方法,可以从policy 设置 WebRtcUdpPortRange 去进行设置。
这个可以通过设置一个webrtc代理的方案 比如coturn,整个流程为
ue---》coturn---》web
coturn支持端口限制,来曲线救国。另外,peer-stream可以一键配置stun和turn服务,在.signal.js中。
2_V3ZNK2E4K$@~NJ YGME9

@ycn2022
Copy link
Author

ycn2022 commented Oct 13, 2023

stun只解决了内网ip之间的直连,没有解决NAT服务器直接限制端口的问题。还是需要一个单端口的方案,所有的连接都通过同一个端口通信,请问有可能再加一层转发,把UE出来的WebRTC视频流的多个端口转发到同一个端口和客户端建立连接吗?

@ycn2022
Copy link
Author

ycn2022 commented Oct 13, 2023

查资料有一种方式是通过SFU 服务器中转,我们这个项目是否可以配置SFU服务器?

@Cat-Wong
Copy link

我也遇到这样的问题,请问找到解决办法了吗

@zhangmeng9005
Copy link

遇到了同样的问题,临时没有思路,不知道道友们有没有好的方案

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants