Невозможно подключиться к COTURN серверу с локального хоста - PullRequest
0 голосов
/ 03 мая 2020

Я новичок в webRT C и хотел попробовать. Это моя установка, ниже которой все работают на localhost. Я запускаю установку на веб-клиентах MacOS

2 на chrome браузере сервера CURNURN, работающем по механизму сигнализации localhost, который выполняется на сервере с использованием socket.io lib, который также работает на localhost

невозможно получить удаленные аудио- и видеоданные на веб-клиентах.

Вот так я установил coturn

brew install coturn

Я не выполнил никакой пользовательской конфигурации.

Вот так у меня работает сервер coturn

turnserver --no-auth --verbose

Вот так у меня работает веб-сервер

node index.js

Это конфигурация webRT C в javascript, которая выполняется в браузере Chrome

var pcConfig = { 'iceServers': [ { 'urls': 'turn:localhost:3478', 'credential': 'test', 'username': 'test' } ], iceTransportPolicy: "relay" };

Это ошибка, которую я вижу в chrome : // webrt c -internals / URL

icecandidateerror url: turn:localhost:3478?transport=tcp address: [0:0:0:x:x:x:x:x] port: 61077 host_candidate: [0:0:0:x:x:x:x:x]:61077 error_text: TURN allocate request timed out. error_code: 701

Это журнал вывода данных

0: log file opened: /var/tmp/turn_21094_2020-05-02.log
0: WARNING: Cannot find config file: turnserver.conf. Default and command-line settings will be used.
0: WARNING: Cannot find config file: turnserver.conf. Default and command-line settings will be used.
0: 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Coturn-4.5.1.1 'dan Eider'
0: 
Max number of open files/sockets allowed for this process: 32767
0: 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 16000 (approximately)
0: 

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: DTLS 1.2 supported
0: TURN/STUN ALPN supported
0: Third-party authorization (oAuth) supported
0: GCM (AEAD) supported
0: OpenSSL compile-time version: OpenSSL 1.1.1d  10 Sep 2019 (0x1010104f)
0: 
0: SQLite supported, default database location is /usr/local/Cellar/coturn/4.5.1.1_1/var/db/turndb
0: Redis is not supported
0: PostgreSQL is not supported
0: MySQL is not supported
0: MongoDB is not supported
0: 
0: Default Net Engine version: 1 (UDP listening socket per session)

=====================================================

0: Domain name: 
0: Default realm: 
0: ERROR: 
CONFIG ERROR: Empty cli-password, and so telnet cli interface is disabled! Please set a non empty cli-password!
0: WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering listener addresses: =========
0: Listener address to use: 127.0.0.1
0: Listener address to use: ::1
0: Listener address to use: 192.168.0.10
0: Listener address to use: 2601:647:4001:73e0:83:ba63:ccbf:4787
0: Listener address to use: 2601:647:4001:73e0:983b:50cc:a7b8:c474
0: Listener address to use: 172.131.240.199
0: Listener address to use: 2001:4998:effd:7801::1041
0: =====================================================
0: Total: 5 'real' addresses discovered
0: =====================================================
0: NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering relay addresses: =============
0: Relay address to use: 192.168.0.10
0: Relay address to use: 172.131.240.199
0: Relay address to use: 2601:647:4001:73e0:83:ba63:ccbf:4787
0: Relay address to use: 2601:647:4001:73e0:983b:50cc:a7b8:c474
0: Relay address to use: 2001:4998:effd:7801::1041
0: =====================================================
0: Total: 5 relay addresses discovered
0: =====================================================
Cannot create pid file: /var/run/turnserver.pid: Permission denied
0: Cannot create pid file: /var/run/turnserver.pid
0: pid file created: /var/tmp/turnserver.pid
0: IO method (main listener thread): kqueue
0: IPv6: On this platform, I am using alternative behavior of TTL (HOPLIMIT) according to RFC 6156.
0: Wait for relay ports initialization...
0:   relay 192.168.0.10 initialization...
0:   relay 192.168.0.10 initialization done
0:   relay 172.131.240.199 initialization...
0:   relay 172.131.240.199 initialization done
0:   relay 2601:647:4001:73e0:83:ba63:ccbf:4787 initialization...
0:   relay 2601:647:4001:73e0:83:ba63:ccbf:4787 initialization done
0:   relay 2601:647:4001:73e0:983b:50cc:a7b8:c474 initialization...
0:   relay 2601:647:4001:73e0:983b:50cc:a7b8:c474 initialization done
0:   relay 2001:4998:effd:7801::1041 initialization...
0:   relay 2001:4998:effd:7801::1041 initialization done
0: Relay ports initialization done
0: IO method (general relay thread): kqueue
0: turn server id=0 created
0: IO method (general relay thread): kqueue
0: turn server id=1 created
0: IO method (general relay thread): kqueue
0: turn server id=2 created
0: IO method (general relay thread): kqueue
0: turn server id=3 created
0: IO method (general relay thread): kqueue
0: turn server id=4 created
0: IO method (general relay thread): kqueue
0: turn server id=5 created
0: IO method (general relay thread): kqueue
0: turn server id=6 created
0: IO method (general relay thread): kqueue
0: turn server id=7 created
0: IO method (general relay thread): kqueue
0: turn server id=8 created
0: IO method (general relay thread): kqueue
0: turn server id=9 created
0: IO method (general relay thread): kqueue
0: turn server id=10 created
0: IO method (general relay thread): kqueue
0: turn server id=11 created
0: IPv4. UDP listener opened on: 127.0.0.1:3478
0: IPv4. UDP listener opened on: 127.0.0.1:3479
0: IPv6. UDP listener opened on: ::1:3478
0: IPv6. UDP listener opened on: ::1:3479
0: IPv4. UDP listener opened on: 192.168.0.10:3478
0: IPv4. UDP listener opened on: 192.168.0.10:3479
0: IPv6. UDP listener opened on: 2601:647:4001:73e0:83:ba63:ccbf:4787:3478
0: IPv6. UDP listener opened on: 2601:647:4001:73e0:83:ba63:ccbf:4787:3479
0: IPv6. UDP listener opened on: 2601:647:4001:73e0:983b:50cc:a7b8:c474:3478
0: IPv6. UDP listener opened on: 2601:647:4001:73e0:983b:50cc:a7b8:c474:3479
0: IPv4. UDP listener opened on: 172.131.240.199:3478
0: IPv4. UDP listener opened on: 172.131.240.199:3479
0: IPv6. UDP listener opened on: 2001:4998:effd:7801::1041:3478
0: IPv6. UDP listener opened on: 2001:4998:effd:7801::1041:3479
socket: Protocol not supported
0: IPv4. TCP listener opened on : 127.0.0.1:3478
socket: Protocol not supported
0: IPv4. TCP listener opened on : 127.0.0.1:3479
socket: Protocol not supported
0: IPv6. TCP listener opened on : ::1:3478
socket: Protocol not supported
0: IPv6. TCP listener opened on : ::1:3479
socket: Protocol not supported
0: IPv4. TCP listener opened on : 192.168.0.10:3478
socket: Protocol not supported
0: IPv4. TCP listener opened on : 192.168.0.10:3479
socket: Protocol not supported
0: IPv6. TCP listener opened on : 2601:647:4001:73e0:83:ba63:ccbf:4787:3478
socket: Protocol not supported
0: IPv6. TCP listener opened on : 2601:647:4001:73e0:83:ba63:ccbf:4787:3479
socket: Protocol not supported
0: IPv6. TCP listener opened on : 2601:647:4001:73e0:983b:50cc:a7b8:c474:3478
socket: Protocol not supported
0: IPv6. TCP listener opened on : 2601:647:4001:73e0:983b:50cc:a7b8:c474:3479
socket: Protocol not supported
0: IPv4. TCP listener opened on : 172.131.240.199:3478
socket: Protocol not supported
0: IPv4. TCP listener opened on : 172.131.240.199:3479
socket: Protocol not supported
0: IPv6. TCP listener opened on : 2001:4998:effd:7801::1041:3478
socket: Protocol not supported
0: IPv6. TCP listener opened on : 2001:4998:effd:7801::1041:3479
0: Total General servers: 12
0: IO method (auth thread): kqueue
0: IO method (auth thread): kqueue
0: IO method (auth thread): kqueue
0: IO method (auth thread): kqueue
0: IO method (auth thread): kqueue
0: IO method (auth thread): kqueue
0: IO method (admin thread): kqueue
0: SQLite DB connection success: /usr/local/Cellar/coturn/4.5.1.1_1/var/db/turndb
6: IPv6. tcp or tls connected to: ::1:51182
6: IPv6. tcp or tls connected to: ::1:51183
6: IPv6. tcp or tls connected to: ::1:51184
6: IPv6. tcp or tls connected to: ::1:51185
6: IPv6. Local relay addr: ::1:58105
6: IPv6. Local relay addr: ::1:52192
6: IPv6. Local relay addr: ::1:59628
6: session 003000000000000001: new, realm=<>, username=<>, lifetime=600
6: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: IPv6. Local relay addr: ::1:53728
6: session 008000000000000001: new, realm=<>, username=<>, lifetime=600
6: session 002000000000000001: new, realm=<>, username=<>, lifetime=600
6: session 009000000000000001: new, realm=<>, username=<>, lifetime=600
6: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: IPv6. tcp or tls connected to: ::1:51186
6: IPv6. tcp or tls connected to: ::1:51187
6: IPv6. tcp or tls connected to: ::1:51188
6: IPv6. tcp or tls connected to: ::1:51189
6: IPv6. Local relay addr: ::1:58982
6: session 002000000000000002: new, realm=<>, username=<>, lifetime=600
6: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
6: IPv6. Local relay addr: ::1:50091
6: IPv6. Local relay addr: ::1:64548
6: IPv6. Local relay addr: ::1:59514
6: session 007000000000000001: new, realm=<>, username=<>, lifetime=600
6: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 004000000000000001: new, realm=<>, username=<>, lifetime=600
6: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 005000000000000001: new, realm=<>, username=<>, lifetime=600
6: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
6: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
7: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
7: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
7: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
7: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
7: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
7: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
7: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
7: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
9: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
9: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
9: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
9: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
9: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
9: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
9: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
9: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
13: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
13: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
13: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
13: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
13: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
13: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
13: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
13: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
21: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
21: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
21: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
21: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
21: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
21: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
21: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
21: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
29: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
29: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
29: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
29: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
29: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
29: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
29: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
29: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
37: session 002000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
37: session 003000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
37: session 008000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
37: session 009000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
37: session 002000000000000002: realm <> user <>: incoming packet ALLOCATE processed, success
37: session 007000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
37: session 004000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
37: session 005000000000000001: realm <> user <>: incoming packet ALLOCATE processed, success
50: session 003000000000000001: TCP socket closed remotely [::1]:51182
50: session 003000000000000001: usage: realm=<>, username=<>, rp=9, rb=252, sp=9, sb=972
50: session 003000000000000001: closed (2nd stage), user <> realm <> origin <>, local [::1]:3478, remote [::1]:51182, reason: TCP connection closed by client (callback)
50: session 002000000000000001: TCP socket closed remotely [::1]:51183
50: session 002000000000000001: usage: realm=<>, username=<>, rp=9, rb=252, sp=9, sb=972
50: session 003000000000000001: delete: realm=<>, username=<>
50: session 008000000000000001: TCP socket closed remotely [::1]:51184
50: session 008000000000000001: usage: realm=<>, username=<>, rp=9, rb=252, sp=9, sb=972
50: session 008000000000000001: closed (2nd stage), user <> realm <> origin <>, local [::1]:3478, remote [::1]:51184, reason: TCP connection closed by client (callback)
50: session 002000000000000001: closed (2nd stage), user <> realm <> origin <>, local [::1]:3478, remote [::1]:51183, reason: TCP connection closed by client (callback)
50: session 009000000000000001: TCP socket closed remotely [::1]:51185
50: session 009000000000000001: usage: realm=<>, username=<>, rp=9, rb=252, sp=9, sb=972
50: session 008000000000000001: delete: realm=<>, username=<>
50: session 002000000000000001: delete: realm=<>, username=<>
50: session 009000000000000001: closed (2nd stage), user <> realm <> origin <>, local [::1]:3478, remote [::1]:51185, reason: TCP connection closed by client (callback)
50: session 009000000000000001: delete: realm=<>, username=<>
50: session 002000000000000002: TCP socket closed remotely [::1]:51186
50: session 007000000000000001: TCP socket closed remotely [::1]:51187
50: session 002000000000000002: usage: realm=<>, username=<>, rp=9, rb=252, sp=9, sb=972
50: session 004000000000000001: TCP socket closed remotely [::1]:51188
50: session 002000000000000002: closed (2nd stage), user <> realm <> origin <>, local [::1]:3478, remote [::1]:51186, reason: TCP connection closed by client (callback)
50: session 004000000000000001: usage: realm=<>, username=<>, rp=9, rb=252, sp=9, sb=972
50: session 005000000000000001: TCP socket closed remotely [::1]:51189
50: session 007000000000000001: usage: realm=<>, username=<>, rp=9, rb=252, sp=9, sb=972
50: session 002000000000000002: delete: realm=<>, username=<>
50: session 004000000000000001: closed (2nd stage), user <> realm <> origin <>, local [::1]:3478, remote [::1]:51188, reason: TCP connection closed by client (callback)
50: session 005000000000000001: usage: realm=<>, username=<>, rp=9, rb=252, sp=9, sb=972
50: session 007000000000000001: closed (2nd stage), user <> realm <> origin <>, local [::1]:3478, remote [::1]:51187, reason: TCP connection closed by client (callback)
50: session 004000000000000001: delete: realm=<>, username=<>
50: session 005000000000000001: closed (2nd stage), user <> realm <> origin <>, local [::1]:3478, remote [::1]:51189, reason: TCP connection closed by client (callback)
50: session 007000000000000001: delete: realm=<>, username=<>
50: session 005000000000000001: delete: realm=<>, username=<> 

Насколько я понимаю, Chrome браузер ждет для сервера TURN, чтобы ответить, но время ожидания и закрывает соединение. Это правильно? Если так, то почему сервер TURN не отвечает? Я новичок в webRT C и не знаю, что мне нужно искать. Может кто-нибудь помочь, пожалуйста, о том, что я делаю неправильно, или где я должен искать проблему?

Примечание. Если я удаляю iceTransportPolicy: "relay", я могу получать видео и аудио потоки. Только когда я включаю ретрансляцию, потоки не отправляются равноправным соединениям.

...