0

我现在尝试配置 CoTURN,但我遇到了一些问题。

使用 STUN 我没有麻烦,当我测试 TURN 时,我在浏览器中收到错误:“ICE 失败,请参阅 about:webrtc 了解更多详细信息”。

现在我想测试匿名 TURN。我的配置是:

listening-port=3478    
min-port=49152
max-port=49200
no-auth
log-file=/var/tmp/turn.log
no-stun  

我在 js 中的对等配置:

var peerConf = {
    'iceServers': [
        {
            "url": "stun:xxx.xxx.xxx.xxx:3478"
        },
        {
            "url": "turn:xxx.xxx.xxx.xxx:3478?transport=tcp",
            "credential": 'abcd',
            "username": 'abcd'
        },
        {
            "url": "turn:xxx.xxx.xxx.xxx:3478?transport=udp",
            "credential": 'abcd',
            "username": 'abcd'
        }]
};

日志返回我这个:

285: handle_udp_packet: New UDP endpoint: local addr aaa.aaa.aaa.aaa:3478, remote addr bbb.bbb.bbb.bbb:49920
285: handle_turn_command: STUN method 0x1 ignored
285: IPv4. Local relay addr: aaa.aaa.aaa.aaa:49180
285: session 001000000000000001: new, realm=<>, username=<>, lifetime=10
285: session 001000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
285: handle_udp_packet: New UDP endpoint: local addr aaa.aaa.aaa.aaa:3478, remote addr bbb.bbb.bbb.bbb:49921
285: handle_turn_command: STUN method 0x1 ignored
285: IPv4. Local relay addr: aaa.aaa.aaa.aaa:49183
285: session 002000000000000001: new, realm=<>, username=<>, lifetime=10
285: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
285: handle_turn_command: STUN method 0x1 ignored
285: IPv4. tcp or tls connected to: bbb.bbb.bbb.bbb:53133
285: IPv4. tcp or tls connected to: bbb.bbb.bbb.bbb:53132
285: IPv4. Local relay addr: aaa.aaa.aaa.aaa:49168
285: session 001000000000000002: new, realm=<>, username=<>, lifetime=10
285: session 001000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
285: IPv4. Local relay addr: aaa.aaa.aaa.aaa:49191
285: session 001000000000000003: new, realm=<>, username=<>, lifetime=10
285: session 001000000000000003: realm <> user <>: incoming packet ALLOCATE processed, success
285: session 001000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
285: handle_turn_command: STUN method 0x1 ignored
285: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
285: handle_turn_command: STUN method 0x1 ignored
285: session 001000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
285: handle_turn_command: STUN method 0x1 ignored
285: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
286: handle_turn_command: STUN method 0x1 ignored
286: session 001000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
286: handle_turn_command: STUN method 0x1 ignored
286: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
287: handle_turn_command: STUN method 0x1 ignored
287: session 001000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
287: handle_turn_command: STUN method 0x1 ignored
287: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
288: handle_turn_command: STUN method 0x1 ignored
288: session 001000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
288: handle_turn_command: STUN method 0x1 ignored
288: handle_udp_packet: New UDP endpoint: local addr aaa.aaa.aaa.aaa:3478, remote addr ccc.ccc.ccc.ccc:47718
288: handle_turn_command: STUN method 0x1 ignored
288: IPv4. Local relay addr: aaa.aaa.aaa.aaa:49187
288: session 003000000000000001: new, realm=<>, username=<>, lifetime=600
288: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
288: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
288: handle_turn_command: STUN method 0x1 ignored
288: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
288: handle_turn_command: STUN method 0x1 ignored
288: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
289: IPv4. tcp or tls connected to: ccc.ccc.ccc.ccc:35396
289: IPv4. Local relay addr: aaa.aaa.aaa.aaa:49166
289: session 003000000000000002: new, realm=<>, username=<>, lifetime=600
289: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
289: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
289: IPv4. tcp or tls connected to: ccc.ccc.ccc.ccc:35397
289: handle_turn_command: STUN method 0x1 ignored
289: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
289: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
289: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
290: handle_turn_command: STUN method 0x1 ignored
290: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
290: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
291: handle_turn_command: STUN method 0x1 ignored
291: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
291: handle_turn_command: STUN method 0x1 ignored
291: session 001000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
291: handle_turn_command: STUN method 0x1 ignored
292: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
292: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
293: handle_turn_command: STUN method 0x1 ignored
293: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
293: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
294: handle_turn_command: STUN method 0x1 ignored
294: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
295: session 001000000000000001: closed (2nd stage), user <> realm <> origin <>, local aaa.aaa.aaa.aaa:3478, remote bbb.bbb.bbb.bbb:49920, reason: allocation timeout
295: session 001000000000000001: delete: realm=<>, username=<>
295: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
295: session 002000000000000001: closed (2nd stage), user <> realm <> origin <>, local aaa.aaa.aaa.aaa:3478, remote bbb.bbb.bbb.bbb:49921, reason: allocation timeout
295: session 002000000000000001: delete: realm=<>, username=<>
295: session 001000000000000002: closed (2nd stage), user <> realm <> origin <>, local aaa.aaa.aaa.aaa:3478, remote bbb.bbb.bbb.bbb:53133, reason: allocation timeout
295: session 001000000000000002: delete: realm=<>, username=<>
295: session 001000000000000003: closed (2nd stage), user <> realm <> origin <>, local aaa.aaa.aaa.aaa:3478, remote bbb.bbb.bbb.bbb:53132, reason: allocation timeout
295: session 001000000000000003: delete: realm=<>, username=<>
296: handle_turn_command: STUN method 0x1 ignored
296: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
297: session 003000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
298: handle_turn_command: STUN method 0x1 ignored
298: handle_turn_command: STUN method 0x1 ignored
298: handle_turn_command: STUN method 0x1 ignored
298: handle_turn_command: STUN method 0x1 ignored
298: session 003000000000000001: closed (2nd stage), user <> realm <> origin <>, local aaa.aaa.aaa.aaa:3478, remote ccc.ccc.ccc.ccc:47718, reason: allocation timeout
298: session 003000000000000001: delete: realm=<>, username=<>
299: session 003000000000000002: closed (2nd stage), user <> realm <> origin <>, local aaa.aaa.aaa.aaa:3478, remote ccc.ccc.ccc.ccc:35396, reason: allocation timeout
299: session 003000000000000002: delete: realm=<>, username=<>
299: session 002000000000000002: TCP socket closed remotely ccc.ccc.ccc.ccc:35397
299: session 002000000000000002: closed (2nd stage), user <> realm <> origin <>, local aaa.aaa.aaa.aaa:3478, remote ccc.ccc.ccc.ccc:35397, reason: TCP connection closed by client (callback)
299: handle_udp_packet: New UDP endpoint: local addr aaa.aaa.aaa.aaa:3478, remote addr ccc.ccc.ccc.ccc:47718
299: handle_turn_command: STUN method 0x1 ignored
301: handle_turn_command: STUN method 0x1 ignored
302: handle_turn_command: STUN method 0x1 ignored
328: handle_turn_command: STUN method 0x1 ignored
329: handle_turn_command: STUN method 0x1 ignored
331: handle_turn_command: STUN method 0x1 ignored
333: handle_turn_command: STUN method 0x1 ignored
359: session 003000000000000003: closed (2nd stage), user <> realm <> origin <>, local aaa.aaa.aaa.aaa:3478, remote ccc.ccc.ccc.ccc:47718, reason: allocation watchdog determined stale session state

请帮帮我。我犯了什么错误?

4

1 回答 1

-1

感谢https://stackoverflow.com/a/35452566/7006485 ,我找到了解决方案。在我的 confs 中缺少“领域”参数。

于 2016-11-14T10:20:49.540 回答