mW3
mW3

Reputation: 189

Can't access turn server built with coturn

I have set up a turn server using coturn in my local machine (ubuntu). The configuration of my turnserver.cnf is given below.


realm=103.30.29.133
fingerprint
listening-ip=0.0.0.0
external-ip=103.30.29.133
relay-ip=0.0.0.0
listening-port=3478
min-port=10000
max-port=20000
log-file=/var/log/turnserver.log
verbose

user=test:1234
lt-cred-mech

I got the value of my external ip 103.30.29.133 from https://www.whatsmyip.org/. After starting turn server it runs well . I can see the following status

● coturn.service - coturn
   Loaded: loaded (/etc/systemd/system/coturn.service; disabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-03-03 11:36:58 +06; 3s ago
     Docs: man:coturn(1)
           man:turnadmin(1)
           man:turnserver(1)
  Process: 21435 ExecStart=/usr/bin/turnserver --daemon --pidfile /run/turnserver/turnserver.pid --syslog -c /etc/turnserver.conf $EXTRA_OPTIONS (code
 Main PID: 21445 (turnserver)
    Tasks: 9 (limit: 4915)
   CGroup: /system.slice/coturn.service
           └─21445 /usr/bin/turnserver --daemon --pidfile /run/turnserver/turnserver.pid --syslog -c /etc/turnserver.conf

But if I check it via https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ , I get the following error

The server stun:103.30.29.133:3478 returned an error with code=701: What possibly went wrong ? How can I fix it ?

Upvotes: 2

Views: 2664

Answers (1)

giavac
giavac

Reputation: 1008

From Mozilla docs:

The following example establishes a handler for icecandidateerrors that occur on the RTCPeerConnection pc. This handler looks specifically for 701 errors that indicate that candidates couldn't reach the STUN or TURN server.

So most probably the browser could not reach the STUN server at the IP and port specified.

It's easy to verify: you can trace the network activity using Wireshark on the computer hosting the browser and tcpdump on the host where the STUN server runs. You should see a STUN Binding Request going to the STUN IP:port, and being received by the STUN server.

In normal conditions a STUN Binding Success Response would be sent back from the STUN server to the browser.

coturn also logs such events, so confirmation whether the request was received or not may be found in its logs.

Upvotes: 2

Related Questions