首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WebRTC: CoTurn不能中继流

WebRTC: CoTurn不能中继流
EN

Stack Overflow用户
提问于 2022-04-22 06:50:43
回答 1查看 353关注 0票数 1

我们在云VM上设置了CoTurn。然后我们用我们的WebRTC演示网站测试它。我们发现它不能中继流,这意味着WebRTC演示的双方在不同的子网中不能相互连接。

根据调查,已做了以下工作:

  1. 我们在Ubuntu20.04上使用CoTurn 4.5.1.1。由apt-get.
  2. The安装CoTurn,在turnserver.conf中设置领域,turnadmin创建的帐户与领域绑定,在云VM中打开
  3. 入站UDP端口1~ 65535。我们在VM中使用netcat来收听udp:50000,并在家里在PC上发送一些数据,当双方都驻留在同一子网中时,数据可以是received.
  4. The WebRTC演示网站。

这是turnserver.conf

代码语言:javascript
复制
listening-device=eth0
listening-port=3478
tls-listening-port=5349
listening-ip=172.16.9.209
relay-ip=172.16.9.209
external-ip=8.136.83.163
server-name=turn.locationbackbone.top
realm=turn.locationbackbone.top
log-file=/var/log/turn.log
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem
fingerprint
lt-cred-mech
user=Jim:Jim
verbose

这是WebRTC演示的设置:

代码语言:javascript
复制
const peerConnection = new RTCPeerConnection({
    iceServers: [{
      urls: 'turn:turn.locationbackbone.top:3478',
      username: 'Jim',
      credential: 'Jim'
    }]
  });

这是来自CoTurn的日志:

代码语言:javascript
复制
18: handle_udp_packet: New UDP endpoint: local addr 172.16.9.209:3478, remote addr 58.39.2.24:22246
18: session 000000000000000001: realm <turn.locationbackbone.top> user <>: incoming packet BINDING processed, success
18: session 000000000000000001: realm <turn.locationbackbone.top> user <>: incoming packet message processed, error 401: Unauthorized
18: handle_udp_packet: New UDP endpoint: local addr 172.16.9.209:3478, remote addr 58.39.2.24:22247
18: session 000000000000000002: realm <turn.locationbackbone.top> user <>: incoming packet BINDING processed, success
18: session 000000000000000002: realm <turn.locationbackbone.top> user <>: incoming packet message processed, error 401: Unauthorized
18: IPv4. Local relay addr: 172.16.9.209:58189
18: session 000000000000000002: new, realm=<turn.locationbackbone.top>, username=<Jim>, lifetime=600
18: session 000000000000000002: realm <turn.locationbackbone.top> user <Jim>: incoming packet ALLOCATE processed, success
18: IPv4. Local relay addr: 172.16.9.209:53152
18: session 000000000000000001: new, realm=<turn.locationbackbone.top>, username=<Jim>, lifetime=600
18: session 000000000000000001: realm <turn.locationbackbone.top> user <Jim>: incoming packet ALLOCATE processed, success
19: session 000000000000000001: refreshed, realm=<turn.locationbackbone.top>, username=<Jim>, lifetime=0
19: session 000000000000000001: realm <turn.locationbackbone.top> user <Jim>: incoming packet REFRESH processed, success
19: handle_udp_packet: New UDP endpoint: local addr 172.16.9.209:3478, remote addr 182.139.173.74:49318
19: session 000000000000000003: realm <turn.locationbackbone.top> user <>: incoming packet BINDING processed, success
19: session 000000000000000003: realm <turn.locationbackbone.top> user <>: incoming packet message processed, error 401: Unauthorized
19: IPv4. Local relay addr: 172.16.9.209:64834
19: session 000000000000000003: new, realm=<turn.locationbackbone.top>, username=<Jim>, lifetime=600
19: session 000000000000000003: realm <turn.locationbackbone.top> user <Jim>: incoming packet ALLOCATE processed, success
19: session 000000000000000002: peer 182.139.173.74 lifetime updated: 300
19: session 000000000000000002: realm <turn.locationbackbone.top> user <Jim>: incoming packet CREATE_PERMISSION processed, success
19: session 000000000000000002: peer 172.16.9.209 lifetime updated: 300
19: session 000000000000000002: realm <turn.locationbackbone.top> user <Jim>: incoming packet CREATE_PERMISSION processed, success
20: session 000000000000000001: usage: realm=<turn.locationbackbone.top>, username=<Jim>, rp=4, rb=272, sp=4, sb=436
20: session 000000000000000001: closed (2nd stage), user <Jim> realm <turn.locationbackbone.top> origin <>, local 172.16.9.209:3478, remote 58.39.2.24:22246, reason: allocation timeout
20: session 000000000000000001: delete: realm=<turn.locationbackbone.top>, username=<Jim>

这是来自chrome://webrtc-internals的“ICE候选网格”

代码语言:javascript
复制
RTCIceCandidatePair_pNDACBB9_Rh5SDnOq   in-progress wifi        udp 0x27c1eff04fe3e00   0 / 0   31 / 0  0 / 0       11:21:10 AM
RTCIceCandidate_pNDACBB9    local-candidate 8.136.83.163    58189   relay(udp)  0x27c1eff                   
RTCIceCandidate_Rh5SDnOq    remote-candidate    8.136.83.163    64834   relay   0x27f1eff           

我们使用tshark来捕获服务器的流量。

代码语言:javascript
复制
58.39.2.24      172.16.9.209    25230   3478    STUN    Binding Request
58.39.2.24      172.16.9.209    25231   3478    STUN    Binding Request
172.16.9.209    58.39.2.24      3478    25230   STUN    Binding Success Response XOR-MAPPED-ADDRESS: 58.39.2.24:25230 MAPPED-ADDRESS: 58.39.2.24:25230 RESPONSE-ORIGIN: 8.136.83.163:3478
172.16.9.209    58.39.2.24      3478    25231   STUN    Binding Success Response XOR-MAPPED-ADDRESS: 58.39.2.24:25231 MAPPED-ADDRESS: 58.39.2.24:25231 RESPONSE-ORIGIN: 8.136.83.163:3478
58.39.2.24      172.16.9.209    25231   3478    STUN    Allocate Request UDP
172.16.9.209    58.39.2.24      3478    25231   STUN    Allocate Error Response error-code: 401 (Unauthorized) Unauthorized with nonce realm: turn.locationbackbone.top
58.39.2.24      172.16.9.209    25230   3478    STUN    Allocate Request UDP
172.16.9.209    58.39.2.24      3478    25230   STUN    Allocate Error Response error-code: 401 (Unauthorized) Unauthorized with nonce realm: turn.locationbackbone.top
58.39.2.24      172.16.9.209    25231   3478    STUN    Allocate Request UDP user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    58.39.2.24      3478    25231   STUN    Allocate Success Response XOR-RELAYED-ADDRESS: 8.136.83.163:63533 XOR-MAPPED-ADDRESS: 58.39.2.24:25231 lifetime: 600
58.39.2.24      172.16.9.209    25230   3478    STUN    Allocate Request UDP user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    58.39.2.24      3478    25230   STUN    Allocate Success Response XOR-RELAYED-ADDRESS: 8.136.83.163:55677 XOR-MAPPED-ADDRESS: 58.39.2.24:25230 lifetime: 600
222.211.167.109 172.16.9.209    55666   3478    STUN    Binding Request
172.16.9.209    222.211.167.109 3478    55666   STUN    Binding Success Response XOR-MAPPED-ADDRESS: 222.211.167.109:55666 MAPPED-ADDRESS: 222.211.167.109:55666 RESPONSE-ORIGIN: 8.136.83.163:3478
58.39.2.24      172.16.9.209    25231   3478    STUN    Refresh Request lifetime: 0 user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    58.39.2.24      3478    25231   STUN    Refresh Success Response lifetime: 0
58.39.2.24      172.16.9.209    25230   3478    STUN    CreatePermission Request XOR-PEER-ADDRESS: 192.168.1.128:55666 user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    58.39.2.24      3478    25230   STUN    CreatePermission Success Response
222.211.167.109 172.16.9.209    55666   3478    STUN    Allocate Request UDP
172.16.9.209    222.211.167.109 3478    55666   STUN    Allocate Error Response error-code: 401 (Unauthorized) Unauthorized with nonce realm: turn.locationbackbone.top
58.39.2.24      172.16.9.209    25230   3478    STUN    CreatePermission Request XOR-PEER-ADDRESS: 222.211.167.109:55666 user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    58.39.2.24      3478    25230   STUN    CreatePermission Success Response
222.211.167.109 172.16.9.209    55666   3478    STUN    Allocate Request UDP user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    222.211.167.109 3478    55666   STUN    Allocate Success Response XOR-RELAYED-ADDRESS: 8.136.83.163:64761 XOR-MAPPED-ADDRESS: 222.211.167.109:55666 lifetime: 600
58.39.2.24      172.16.9.209    25230   3478    STUN    CreatePermission Request XOR-PEER-ADDRESS: 8.136.83.163:64761 user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    58.39.2.24      3478    25230   STUN    CreatePermission Success Response
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   3478    STUN    Binding Request
172.16.9.209    58.39.2.24      3478    25230   STUN    Binding Success Response XOR-MAPPED-ADDRESS: 58.39.2.24:25230 MAPPED-ADDRESS: 58.39.2.24:25230 RESPONSE-ORIGIN: 8.136.83.163:3478
58.39.2.24      172.16.9.209    25230   64761   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 192.168.1.128:55666
172.16.9.209    192.168.1.128   55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 222.211.167.109:55666
172.16.9.209    222.211.167.109 55677   55666   STUN    Binding Request user: l3iy:poWX
58.39.2.24      172.16.9.209    25230   3478    STUN    Send Indication XOR-PEER-ADDRESS: 8.136.83.163:64761
58.39.2.24      172.16.9.209    25230   3478    STUN    Refresh Request lifetime: 0 user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    58.39.2.24      3478    25230   STUN    Refresh Success Response lifetime: 0
222.211.167.109 172.16.9.209    55666   3478    STUN    Refresh Request lifetime: 0 user: Jim realm: turn.locationbackbone.top with nonce
172.16.9.209    222.211.167.109 3478    55666   STUN    Refresh Success Response lifetime: 0

我们注意到被调用方只能接收以下消息:coturn:3478 -> callee STUN,因为端口3478是被调用方向其发送数据包的唯一端口。由协转服务器的其他端口发送的数据包丢失。我们怀疑NAT是一种端口限制锥,甚至对称。

我们怎样才能启动继电器?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-04-30 08:09:23

有两个客户端(A来自58.39.2.24:25230,B来自222.211.167.109:55666)。两者都成功地获得了分配(分别为8.136.83.163:556778.136.83.163:64761 )。

然后客户机A创建3个权限,一个用于192.168.1.128:55666 (私有,可能不可用),一个用于222.211.167.109:55666 (直接),另一个用于8.136.83.163:64761 (中继)。

然后客户端A开始向3个目标发送眩晕绑定请求。那些注定是222.211.167.109:55666的人永远得不到答案,所以它必须是无法到达的。

客户端B应该为8.136.83.163:55677创建一个权限,这样coturn将允许传递来自A的眩晕绑定请求,从而实现中继到中继的连接:<-->协转<-->协转<-->转换<->B。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71964539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档