且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

防火墙中应该允许哪些端口使用 TURN 服务器?

更新时间:2023-11-10 20:09:28

我认为这取决于您要使用的传输协议和安全级别.

I think it depends on the transport protocols you want to use and the level of security.

使用 Coturn coturn(git):

With Coturn coturn(git):

发送(或监听)STUN/TURN 请求的默认端口是 3478.

The default port for sending (or listening to) STUN/TURN requests is 3478.

UDP 和 TCP 侦听器的 TURN 侦听器端口(默认值:3478).笔记:实际上,TLS &DTLS 会话可以连接到普通"会话.TCP &UDP端口也一样 - 如果配置允许.例如,默认侦听端口可以设置为 80 或 443,以绕过一些严格的 NAT.请记住端口

TURN listener port for UDP and TCP listeners (Default: 3478). Note: actually, TLS & DTLS sessions can connect to the "plain" TCP & UDP port(s), too - if allowed by configuration. For example, the default listening port can be set to 80 or 443, to go around some strict NATs. Remember that ports < 1024 may require superuser privileges to start the turnserver process.

在我的项目中,我也使用了 tls 侦听端口,但可能没有必要:

In my project I used also tls listening port but probably it is not necessary:

通过 TLS 发送(或侦听)STUN/TURN 的默认端口是 5349.

The default port for sending (or listening to) STUN/TURN over TLS is 5349.

TLS 和 DTLS 侦听器的 TURN 侦听器端口(默认值:5349).注意:实际上,普通"TCP &UDP 会话可以连接到 TLS &DTLS 端口,也是 - 如果配置允许.例如,默认的 tls 侦听端口可以设置为 443,以绕过一些严格的 NAT.请记住端口

TURN listener port for TLS and DTLS listeners (Default: 5349). Note: actually, "plain" TCP & UDP sessions can connect to the TLS & DTLS port(s), too - if allowed by configuration. For example, the default tls listening port can be set to 443, to go around some strict NATs. Remember that ports < 1024 may require superuser privileges to start the turnserver process. For secure TCP connections, we currently support SSL version 3 and TLS versions 1.0, 1.1, 1.2. For secure UDP connections, we support DTLS version 1.

此外,用于建立最后的 p2p 连接:

Also, for establishing at last p2p connection :

每个客户端将通过 UDP 将数据发送到另一个端点:如果它发送到 TURN 服务器(到中继候选),它将发送到 49152-65535 之间的端口(如果它直接发送到另一方,它将发送到 0-65535 范围内的任何端口)

Each client will send the data through UDP to the other endpoint: if it’s sending to a TURN server (to a relay candidate) it will send to a port between 49152-65535 (if it’s sending directly to the other party it will send to any port in the 0-65535 range)

--min-port 中继端点分配的 UDP 端口范围的下限.根据 RFC 5766,默认值为 49152.

--min-port Lower bound of the UDP port range for relay endpoints allocation. Default value is 49152, according to RFC 5766.

--max-port 用于中继端点分配的 UDP 端口范围的上限.根据 RFC 5766,默认值为 65535.

--max-port Upper bound of the UDP port range for relay endpoints allocation. Default value is 65535, according to RFC 5766.