Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Co-Turn server not working properly for Web RTC project

I have a turn server which is using co-turn and hosted on GCP.

And already installed the server successfully without any error and enabled the port.

But when I used it back on my web rtc project, it seems like it's not working because my application only works only on the same router or network.

It's not working on a different network.

I tried checking on https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ and get the following result which says it is fine.

So, i'm a bit lost about where to check anymore.

Please kindly help me what I can check anywhere else. Thanks.

enter image description here

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

Updated after adding external IP.

enter image description here

Latest Update

When I debug on chrome://webrtc-internals/, there is an error message on icecandidateerror event which state as Unauthorized.

url: turn:turn.xxxxx.live:5349?transport=udp
address: 10.19.95.x
port: 41207
host_candidate: 10.19.95.x:41207
error_text: Unauthorized
error_code: 401

When I recheck the turn server which I created with reference to this link, I still have user=guest:somepassword line, so trying my server with that password to confirm if it is the user issue.

Still no luck though. Please help me guide where did I need to look more into.

Since I'm new to this technology and infrastructure, I'm a bit lost here.

like image 399
Mg Thar Avatar asked Jun 10 '20 05:06

Mg Thar


People also ask

Do you need a TURN server for WebRTC?

For most WebRTC applications to function a server is required for relaying the traffic between peers, since a direct socket is often not possible between the clients (unless they reside on the same local network). The common way to solve this is by using a TURN server.

How does Coturn server work?

TURN is a client-server protocol that was created to work around the problems for Voice over IP implementations presented by a NAT. The TURN protocol utilizes a TURN server to relay data from a client to any number of peers. Contact us to discuss your network application requirements.

Does SFU need TURN server?

You should still use a TURN server when running an SFU. To understand diving into ICE a little bit will help. All SFUs work a little differently, but this is true for most. This IP/Port combination is giving to each peer who then attempts to contact the SFU.

What is TURN server in WebRTC?

TURN server. For most WebRTC applications to function a server is required for relaying the traffic between peers, since a direct socket is often not possible between the clients (unless they reside on the same local network). The common way to solve this is by using a TURN server.

How to reduce latency in spreed WebRTC with coturn?

Note: To reduce latency, the TURN server should be close to users and be aware that TURN server consumes lots of bandwidth as it will rely both audio and video. Coturn can be on the same machine with Spreed WebRTC or on another machine that is not behind NAT. Coturn is available from the Ubuntu repository, so install it with the following command:

What is a coturn server?

Coturn is a free and open-source TURN and STUN server for VoIP and WebRTC. In a previous tutorial, we discussed how to install Spreed WebRTC server and how to integrate Spreed WebRTC with NextCloud.

What is TURN server?

The TURN Server is a VoIP media traffic NAT traversal server and gateway. It can be used as a general-purpose network traffic TURN server and gateway, too. On-line management interface (over telnet or over HTTPS) for the TURN server is available. The implementation also includes some extra ...


1 Answers

10.138.0.2 probably isn't what you want. Edit the coturn config to set a --external-ip value that is the external IP of your TURN server. This page should print the world routable IP of your TURN server, not 10.138.0.2

When you create a new PeerConnection are you sure you are passing the values properly? Can you confirm that onicecandidate emits srflx and relay candidates? This probably isn't the issue, but worth checking.

like image 200
Sean DuBois Avatar answered Oct 10 '22 16:10

Sean DuBois