I have a web and standalone applications that use WebRTC.
I have my own coturn server on Amazon EC2. I configure everything based on that article (maybe it was a mistake?). I test my apps with this stun/turn server and everything works just fine for Chrome, Edge, Safari, but does not work for Mozilla Firefox (Offer and Answer were generated). I received the following error in a console:
ICE failed, your TURN server appears to be broken, see about:webrtc for more details
I assume that I misconfigure something, so this is why it doesn't work.
EC2 machine I used:
2x private IP,
2x public IP (Elastic IP),
tier: T2.micro,
UDP/TCP ports are open.
Configuration of coturn (/etc/turnserver.conf file):
listening-ip=0.0.0.0
external-ip={publicIP}:{privateIP}
external-port=3478
fingerprint
realm={publicIP}
lt-cred-mech
user={username}:{password}
log-file=/var/tmp/turn.log
verbose
Stun/Turn server configuration in a code:
RTCConfiguration.Create([|
RTCIceServer.Create([|
"stun:{publicIP}:3478"
"turn:{publicIP}:3478"
|], {userName}, {password}, RTCIceCredentialType.Password)
|])
And the transport policy set to all.
And the whole turn.log for only this request from Mozilla:
0: log file opened: /var/tmp/turn_2020-04-03.log
0: pid file created: /var/run/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: WARNING: I cannot support STUN CHANGE_REQUEST functionality because only one IP address is provided
0: Wait for relay ports initialization...
0: relay 0.0.0.0 initialization...
0: relay 0.0.0.0 initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=1 created
0: IPv4. SCTP listener opened on : 0.0.0.0:3478
0: IPv4. TCP listener opened on : 0.0.0.0:3478
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: IPv4. TCP listener opened on : 0.0.0.0:3478
0: IPv4. UDP listener opened on: 0.0.0.0:3478
0: Total General servers: 2
0: IO method (admin thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)
0: SQLite DB connection success: /var/lib/turn/turndb
20: handle_udp_packet: New UDP endpoint: local addr 0.0.0.0:3478, remote addr {remoteIP}:59148
20: session 001000000000000001: realm <{publicIP}> user <>: incoming packet BINDING processed, success
20: handle_udp_packet: New UDP endpoint: local addr 0.0.0.0:3478, remote addr {remoteIP}:49200
20: session 001000000000000002: realm <{publicIP}> user <>: incoming packet message processed, error 401: Unauthorized
21: IPv4. Local relay addr: {privateIP}:15158
21: session 001000000000000002: new, realm=<{publicIP}>, username=<{username}>, lifetime=600
21: session 001000000000000002: realm <{publicIP}> user <{username}>: incoming packet ALLOCATE processed, success
48: handle_udp_packet: New UDP endpoint: local addr 0.0.0.0:3478, remote addr {remoteIP}:62186
48: session 001000000000000003: realm <{publicIP}> user <{username}>: incoming packet message processed, error 438: Wrong nonce
48: session 001000000000000003: realm <{publicIP}> user <{username}>: incoming packet REFRESH processed, error 437: Invalid allocation
48: session 001000000000000003: realm <{publicIP}> user <{username}>: incoming packet message processed, error 437: Invalid allocation
61: handle_udp_packet: New UDP endpoint: local addr 0.0.0.0:3478, remote addr {remoteIP}:49582
61: session 001000000000000004: realm <{publicIP}> user <{username}>: incoming packet message processed, error 438: Wrong nonce
61: session 001000000000000004: realm <{publicIP}> user <{username}>: incoming packet REFRESH processed, error 437: Invalid allocation
61: session 001000000000000004: realm <{publicIP}> user <{username}>: incoming packet message processed, error 437: Invalid allocation
66: session 001000000000000004: realm <{publicIP}> user <{username}>: incoming packet CREATE_PERMISSION processed, success
66: session 001000000000000004: realm <{publicIP}> user <{username}>: incoming packet message processed, error 400: Bad Request
and logs from about:webrtc:
/builds/worker/workspace/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:173 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP4:{localIP}:3478/UDP)
/builds/worker/workspace/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:173 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:IP4:{localIP}:3478/UDP)
/builds/worker/workspace/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): failed to create passive TCP host candidate: 3
STUN-CLIENT(srflx(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)): Timed out
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/CAND(srflx(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)): failed to initialize, 2 remaining
STUN-CLIENT(relay(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)::TURN): Timed out
TURN(relay(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)): mode 20, nr_turn_client_error_cb
TURN(relay(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)) failed
TURN(relay(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)): cancelling
ICE-CANDIDATE(relay(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)): nr_turn_allocated_cb called with state 4
ICE-CANDIDATE(relay(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)): nr_turn_allocated_cb failed
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/CAND(srflx(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)): failed to initialize, 1 remaining
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/CAND(relay(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)): failed to initialize, 0 remaining
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): All candidates initialized
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): peer (PC:21372137213721372 (id=214741111111 url=http://someurl):default) has no stream matching stream PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): peer (PC:21372137213721372 (id=214741111111 url=http://someurl):default) no such component for candidate candidate:foundation 2 udp 2130706431 10.0.22.10 64477 typ host generation 0
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): peer (PC:21372137213721372 (id=214741111111 url=http://someurl):default) no such component for candidate candidate:foundation 2 udp 2130706431 160.21.130.15 64478 typ host generation 0
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): peer (PC:21372137213721372 (id=214741111111 url=http://someurl):default) no such component for candidate candidate:foundation 2 udp 1694498815 10.20.44.17 59873 typ srflx raddr 0.0.0.0 rport 64479 generation 0
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): peer (PC:21372137213721372 (id=214741111111 url=http://someurl):default) no such component for candidate candidate:foundation 2 udp 16777215 {publicIP} 14332 typ relay raddr 0.0.0.0 rport 64480 generation 0
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(AUgV): setting pair to state FROZEN: AUgV|IP4:192.168.0.50:54084/UDP|IP4:10.0.22.10:64477/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 10.0.22.10 64477 typ host generation 0)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/CAND-PAIR(AUgV): Pairing candidate IP4:192.168.0.50:54084/UDP (7e7f00ff):IP4:10.0.22.10:64477/UDP (7effffff) priority=9115005270299246590 (7e7f00fffdfffffe)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(LRw8): setting pair to state FROZEN: LRw8|IP4:192.168.0.50:54084/UDP|IP4:160.21.130.15:64478/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 160.21.130.15 64478 typ host generation 0)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/CAND-PAIR(LRw8): Pairing candidate IP4:192.168.0.50:54084/UDP (7e7f00ff):IP4:160.21.130.15:64478/UDP (7effffff) priority=9115005270299246590 (7e7f00fffdfffffe)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(uAK4): setting pair to state FROZEN: uAK4|IP4:192.168.0.50:54084/UDP|IP4:10.20.44.17:59873/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 1694498815 10.20.44.17 59873 typ srflx raddr 0.0.0.0 rport 64479 generation 0)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/CAND-PAIR(uAK4): Pairing candidate IP4:192.168.0.50:54084/UDP (7e7f00ff):IP4:10.20.44.17:59873/UDP (64ffffff) priority=7277816997780259327 (64fffffffcfe01ff)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(ZzTX): setting pair to state FROZEN: ZzTX|IP4:192.168.0.50:54084/UDP|IP4:{publicIP}:14332/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 16777215 {publicIP} 14332 typ relay raddr 0.0.0.0 rport 64480 generation 0)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/CAND-PAIR(ZzTX): Pairing candidate IP4:192.168.0.50:54084/UDP (7e7f00ff):IP4:{publicIP}:14332/UDP (ffffff) priority=72057593987465727 (fffffffcfe01ff)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(AUgV): setting pair to state WAITING: AUgV|IP4:192.168.0.50:54084/UDP|IP4:10.0.22.10:64477/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 10.0.22.10 64477 typ host generation 0)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac): Starting check timer for stream.
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(AUgV): setting pair to state IN_PROGRESS: AUgV|IP4:192.168.0.50:54084/UDP|IP4:10.0.22.10:64477/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 10.0.22.10 64477 typ host generation 0)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): peer (PC:21372137213721372 (id=214741111111 url=http://someurl):default) is now checking
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): peer (PC:21372137213721372 (id=214741111111 url=http://someurl):default) no streams with pre-answer requests
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(LRw8): setting pair to state WAITING: LRw8|IP4:192.168.0.50:54084/UDP|IP4:160.21.130.15:64478/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 160.21.130.15 64478 typ host generation 0)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(LRw8): setting pair to state IN_PROGRESS: LRw8|IP4:192.168.0.50:54084/UDP|IP4:160.21.130.15:64478/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 160.21.130.15 64478 typ host generation 0)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(uAK4): setting pair to state WAITING: uAK4|IP4:192.168.0.50:54084/UDP|IP4:10.20.44.17:59873/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 1694498815 10.20.44.17 59873 typ srflx raddr 0.0.0.0 rport 64479 generation 0)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(uAK4): setting pair to state IN_PROGRESS: uAK4|IP4:192.168.0.50:54084/UDP|IP4:10.20.44.17:59873/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 1694498815 10.20.44.17 59873 typ srflx raddr 0.0.0.0 rport 64479 generation 0)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(ZzTX): setting pair to state WAITING: ZzTX|IP4:192.168.0.50:54084/UDP|IP4:{publicIP}:14332/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 16777215 {publicIP} 14332 typ relay raddr 0.0.0.0 rport 64480 generation 0)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(ZzTX): setting pair to state IN_PROGRESS: ZzTX|IP4:192.168.0.50:54084/UDP|IP4:{publicIP}:14332/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 16777215 {publicIP} 14332 typ relay raddr 0.0.0.0 rport 64480 generation 0)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default): no FROZEN/WAITING pairs for PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl)): peer (PC:21372137213721372 (id=214741111111 url=http://someurl):default) Trickle grace period is over; marking every component with only failed pairs as failed.
STUN-CLIENT(AUgV|IP4:192.168.0.50:54084/UDP|IP4:10.0.22.10:64477/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 10.0.22.10 64477 typ host generation 0)): Timed out
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(AUgV): setting pair to state FAILED: AUgV|IP4:192.168.0.50:54084/UDP|IP4:10.0.22.10:64477/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 10.0.22.10 64477 typ host generation 0)
STUN-CLIENT(LRw8|IP4:192.168.0.50:54084/UDP|IP4:160.21.130.15:64478/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 160.21.130.15 64478 typ host generation 0)): Timed out
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(LRw8): setting pair to state FAILED: LRw8|IP4:192.168.0.50:54084/UDP|IP4:160.21.130.15:64478/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 160.21.130.15 64478 typ host generation 0)
STUN-CLIENT(uAK4|IP4:192.168.0.50:54084/UDP|IP4:10.20.44.17:59873/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 1694498815 10.20.44.17 59873 typ srflx raddr 0.0.0.0 rport 64479 generation 0)): Timed out
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(uAK4): setting pair to state FAILED: uAK4|IP4:192.168.0.50:54084/UDP|IP4:10.20.44.17:59873/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 1694498815 10.20.44.17 59873 typ srflx raddr 0.0.0.0 rport 64479 generation 0)
STUN-CLIENT(ZzTX|IP4:192.168.0.50:54084/UDP|IP4:{publicIP}:14332/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 16777215 {publicIP} 14332 typ relay raddr 0.0.0.0 rport 64480 generation 0)): Timed out
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/CAND-PAIR(ZzTX): setting pair to state FAILED: ZzTX|IP4:192.168.0.50:54084/UDP|IP4:{publicIP}:14332/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 16777215 {publicIP} 14332 typ relay raddr 0.0.0.0 rport 64480 generation 0)
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/COMP(1): All pairs are failed, and grace period has elapsed. Marking component as failed.
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac): state dump
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac): Local component 1 - dumping candidates
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(EJ0l): host(IP4:192.168.0.50:54084/UDP)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(5pC7): srflx(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(5pC7): srflx(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(0hfs): relay(IP4:192.168.0.50:54084/UDP|IP4:{localIP}:3478/UDP)
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(HrQP): host(IP4:192.168.0.50:50811/TCP) active
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default)/STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac): state dump
CAND-PAIR(AUgV): pair AUgV|IP4:192.168.0.50:54084/UDP|IP4:10.0.22.10:64477/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 10.0.22.10 64477 typ host generation 0): state=FAILED, priority=0x7e7f00fffdfffffe
CAND-PAIR(LRw8): pair LRw8|IP4:192.168.0.50:54084/UDP|IP4:160.21.130.15:64478/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 2130706431 160.21.130.15 64478 typ host generation 0): state=FAILED, priority=0x7e7f00fffdfffffe
CAND-PAIR(uAK4): pair uAK4|IP4:192.168.0.50:54084/UDP|IP4:10.20.44.17:59873/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 1694498815 10.20.44.17 59873 typ srflx raddr 0.0.0.0 rport 64479 generation 0): state=FAILED, priority=0x64fffffffcfe01ff
CAND-PAIR(ZzTX): pair ZzTX|IP4:192.168.0.50:54084/UDP|IP4:{publicIP}:14332/UDP(host(IP4:192.168.0.50:54084/UDP)|candidate:foundation 1 udp 16777215 {publicIP} 14332 typ relay raddr 0.0.0.0 rport 64480 generation 0): state=FAILED, priority=0xfffffffcfe01ff
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac): Remote component 1 in state 3 - dumping candidates
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(9Ozf): candidate:foundation 1 udp 2130706431 10.0.22.10 64477 typ host generation 0
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(N1wD): candidate:foundation 1 udp 2130706431 160.21.130.15 64478 typ host generation 0
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(YlFO): candidate:foundation 1 udp 1694498815 10.20.44.17 59873 typ srflx raddr 0.0.0.0 rport 64479 generation 0
ICE(PC:21372137213721372 (id=214741111111 url=http://someurl))/ICE-STREAM(PC:21372137213721372 (id=214741111111 url=http://someurl) transport-id=transport_0 - 72a938a6:f1234561cb2blablabla0dc711160ac)/CAND(8mKo): candidate:foundation 1 udp 16777215 {publicIP} 14332 typ relay raddr 0.0.0.0 rport 64480 generation 0
ICE-PEER(PC:21372137213721372 (id=214741111111 url=http://someurl):default): all checks completed success=0 fail=1
Any tips what I possibly do wrong would be appreciated!
You should double-check your internal routes defined in AWS for an EC2 instance and some global one about inbound traffic.
Mozilla Firefox would be the only one that would fail to do the "handshake" if the stun/turn server is not available outside of the internal network.
Chrome, EDGE, Safari would work in such a situation and establish a P2P (srflx) connection.
In my situation, there was some additional definition of inbound traffic to all of the AWS instances, which were blocking the traffic to the stun/turn server. I realize that when I was trying to test the WebRTC from one computer (connected to a VPN) to another (not connected to a VPN) and it fails while doing a "handshake".
Im a developping a Samsung Smart TV app with Samsung's TOAST and Caph-angular. I am on Windows 10.
When I call our server, I get an RSRP url encoded with H264 but, on smart TVs, RSRP is not supported. Then I have to "transform" the RSRP url to some webRTC one (I know very little about all this so sorry if the terms are incorrect).
I searched here and there and found Kurento which seems to be able to answer my needs.
Before trying Kurento within my app, I wanted to test it on a few demos.
I was able to test one2many example without any problem but I am having trouble running rtsp2webrtc demo.
I git cloned kms-windows and https://github.com/lulop-k/kurento-rtsp2webrtc and tried to run the demo but the player is not displaying anything.
1) I double-click kms-windows\bin\kurento-media-server
2) I launch http-server in kurento-rtsp2webrtc
3) I reach http://localhost:8080/, type my sample rtsp url (rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov) and click on "start"
No error seems to happen, see console logs:
Local icecandidate {"candidate":"candidate:4033732497 1 udp 2113937151 192.168.0.104 62879 typ host generation 0 ufrag tZFB network-cost 50","sdpMid":"audio","sdpMLineIndex":0}
Local icecandidate {"candidate":"candidate:4033732497 2 udp 2113937150 192.168.0.104 62881 typ host generation 0 ufrag tZFB network-cost 50","sdpMid":"audio","sdpMLineIndex":0}
Local icecandidate {"candidate":"candidate:4033732497 1 udp 2113937151 192.168.0.104 62883 typ host generation 0 ufrag tZFB network-cost 50","sdpMid":"video","sdpMLineIndex":1}
Local icecandidate {"candidate":"candidate:4033732497 2 udp 2113937150 192.168.0.104 62885 typ host generation 0 ufrag tZFB network-cost 50","sdpMid":"video","sdpMLineIndex":1}
PlayerEndpoint-->WebRtcEndpoint connection established
oniceconnectionstatechange -> checking
icegatheringstate -> gathering
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 1 UDP 2013266431 192.168.0.104 61810 typ host","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 1 UDP 2013266431 192.168.0.104 61810 typ host","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:2 1 TCP 1019216127 192.168.0.104 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:2 1 TCP 1019216127 192.168.0.104 9 typ host tcptype active","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:3 1 TCP 1015021823 192.168.0.104 52180 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:3 1 TCP 1015021823 192.168.0.104 52180 typ host tcptype passive","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:4 1 UDP 2013266431 fe80::6403:eba1:c2a3:9605 61812 typ host","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:4 1 UDP 2013266431 fe80::6403:eba1:c2a3:9605 61812 typ host","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:5 1 TCP 1019217663 fe80::6403:eba1:c2a3:9605 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:5 1 TCP 1019217663 fe80::6403:eba1:c2a3:9605 9 typ host tcptype active","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:6 1 TCP 1015023359 fe80::6403:eba1:c2a3:9605 52182 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:6 1 TCP 1015023359 fe80::6403:eba1:c2a3:9605 52182 typ host tcptype passive","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:7 1 UDP 2013266431 fe80::f99b:72cd:cb28:1424 61814 typ host","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:7 1 UDP 2013266431 fe80::f99b:72cd:cb28:1424 61814 typ host","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:8 1 TCP 1019217663 fe80::f99b:72cd:cb28:1424 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:8 1 TCP 1019217663 fe80::f99b:72cd:cb28:1424 9 typ host tcptype active","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:9 1 TCP 1015023359 fe80::f99b:72cd:cb28:1424 52184 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:9 1 TCP 1015023359 fe80::f99b:72cd:cb28:1424 52184 typ host tcptype passive","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:10 1 UDP 2013266431 192.168.56.1 61816 typ host","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:10 1 UDP 2013266431 192.168.56.1 61816 typ host","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:11 1 TCP 1019216895 192.168.56.1 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:11 1 TCP 1019216895 192.168.56.1 9 typ host tcptype active","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:12 1 TCP 1015022591 192.168.56.1 52186 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:12 1 TCP 1015022591 192.168.56.1 52186 typ host tcptype passive","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 2 UDP 2013266430 192.168.0.104 61811 typ host","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:1 2 UDP 2013266430 192.168.0.104 61811 typ host","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:2 2 TCP 1019216126 192.168.0.104 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:2 2 TCP 1019216126 192.168.0.104 9 typ host tcptype active","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:3 2 TCP 1015021822 192.168.0.104 52181 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:3 2 TCP 1015021822 192.168.0.104 52181 typ host tcptype passive","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:4 2 UDP 2013266430 fe80::6403:eba1:c2a3:9605 61813 typ host","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:4 2 UDP 2013266430 fe80::6403:eba1:c2a3:9605 61813 typ host","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:5 2 TCP 1019217662 fe80::6403:eba1:c2a3:9605 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:5 2 TCP 1019217662 fe80::6403:eba1:c2a3:9605 9 typ host tcptype active","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:6 2 TCP 1015023358 fe80::6403:eba1:c2a3:9605 52183 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:6 2 TCP 1015023358 fe80::6403:eba1:c2a3:9605 52183 typ host tcptype passive","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:7 2 UDP 2013266430 fe80::f99b:72cd:cb28:1424 61815 typ host","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:7 2 UDP 2013266430 fe80::f99b:72cd:cb28:1424 61815 typ host","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:8 2 TCP 1019217662 fe80::f99b:72cd:cb28:1424 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:8 2 TCP 1019217662 fe80::f99b:72cd:cb28:1424 9 typ host tcptype active","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:9 2 TCP 1015023358 fe80::f99b:72cd:cb28:1424 52185 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:9 2 TCP 1015023358 fe80::f99b:72cd:cb28:1424 52185 typ host tcptype passive","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:10 2 UDP 2013266430 192.168.56.1 61817 typ host","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:10 2 UDP 2013266430 192.168.56.1 61817 typ host","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:11 2 TCP 1019216894 192.168.56.1 9 typ host tcptype active","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:11 2 TCP 1019216894 192.168.56.1 9 typ host tcptype active","sdpMLineIndex":1,"sdpMid":"video"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:12 2 TCP 1015022590 192.168.56.1 52187 typ host tcptype passive","sdpMLineIndex":0,"sdpMid":"audio"}
Remote icecandidate {"__module__":"kurento","__type__":"IceCandidate","candidate":"candidate:12 2 TCP 1015022590 192.168.56.1 52187 typ host tcptype passive","sdpMLineIndex":1,"sdpMid":"video"}
Player playing ...
oniceconnectionstatechange -> connected
icegatheringstate -> complete
oniceconnectionstatechange -> completed
icegatheringstate -> complete
But the player does not display anything. I still see the spinner.
I tried adding a STUN server (not sure what it is or if I even need one, just saw this in docs or other stackoverflow issues) and it did not solve anything.
Could you please help me?
Did I do anything wrong or forget something?
And, in the future, when I want to implement this into my tv web app, will I only need to include kurento-client.js and kurento-utils.js files or will there be other things to take care of?
Thanks in advance
Stun server cannot traverse symmetric NAT's so for that purpose if your server is behind NAT then you should try using TURN server
if you Kurento server is behind the NAT - you need to use TURN server for it