How do we know whether TURN or STUN server got connected?

3,863 views
Skip to first unread message

Jeetendra

unread,
Dec 12, 2013, 7:17:04 AM12/12/13
to turn-server-project...@googlegroups.com

For TURN and STUN server I am using http://code.google.com/p/rfc5766-turn-server/

Wanted to create diagnostics to know whether STUN or TURN server is connected.

It would be great help if anyone can help me

1) How to implement it on the server.

2) How to implement it on the client side (browser).

Oleg Moskalenko

unread,
Dec 12, 2013, 11:43:56 AM12/12/13
to turn-server-project...@googlegroups.com
on the TURN server, you can check whether a persistent TURN session has been connected. In the telnet CLI monitor, type command "ps <username>" and you will see the TURN sessions of the user, if any.

Jeetendra

unread,
Dec 13, 2013, 2:36:47 AM12/13/13
to turn-server-project...@googlegroups.com
Thanks Oleg.

So is it that we can't get details from client side?
My webRTC application is using Node.js, Express.js and webrtc.io module. The problem we are facing is that our connection is not consistent. Sometime it connects, sometime it doesn't. Sometime one sided connected or we are connected with only audio.

So, wanted to create a interface/tool to see the report at run time what is actually happening.
User will not have access to the server plus they will not be comfortable with the commands to see the TURN session so is there any API's or any other ways available that we can use to create a interface for them and then we can use that report to debug what is happening.

Thanks
Jeetendra

Oleg Moskalenko

unread,
Dec 13, 2013, 2:48:05 AM12/13/13
to turn-server-project...@googlegroups.com
There is no such an interface right now. But I believe that you are looking at this from a wrong angle. There must be a client API to check what the client program is doing. If the client will be asking the TURN server "tell me what I am doing" that would be unnatural and also it will have a potential security risk. Check your client library, there must have some kind of API to inquire the current communication status.

Regards,
Oleg

Sprogrammer

unread,
Dec 16, 2013, 8:01:10 PM12/16/13
to turn-server-project...@googlegroups.com

FYI: 

1) How to implement it on the server.

Practical: (Step 1:)

[root@server2 ~]# service turnserver status



turnserver
(pid  3765) is running...

[root@server2 ~]# telnet localhost 5766

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

TURN
Server

rfc5766
-turn-server

Citrix-3.1.2.3 'Arch Lector'




Type '?' for help

> ?

TURN
Server

rfc5766
-turn-server

Citrix-3.1.2.3 'Arch Lector'




 
?, h, help - print this text




  quit
, q, exit, bye - end CLI session




  stop
, shutdown, halt - shutdown TURN Server




  pc
- print configuration




  tc
<param-name> - toggle a configuration parameter

     
(see pc command output for togglable param names)




  cc
<param-name> <param-value> - change a configuration parameter

     
(see pc command output for changeable param names)




  ps
[username] - print sessions, with optional exact user match




  psp usernamestr
- print sessions, with partial user string match




  pu
- print current users

> pc




  verbose
: OFF

  daemon process
: ON

  stale
-nonce: OFF (*)

  stun
-only: OFF (*)

 
no-stun: OFF (*)

  secure
-stun: OFF (*)

 
do-not-use-config-file: OFF

  RFC5780 support
: ON

 
new net engine: OFF

  enforce fingerprints
: OFF

  mobility
: OFF (*)

  udp
-self-balance: OFF

  pidfile
: /var/run/turnserver.pid

  process user ID
: 496

  process
group ID: 492

  process dir
: /




  cipher
-list: ALL:eNULL:aNULL:NULL

  ec
-curve-name: prime256v1

  DH
-key-length: 1066

  cert
-file: turn_server_cert.pem

  pkey
-file: turn_server_pkey.pem

  SHA type
: SHA1 and SHA256




 
Listener addr: 127.0.0.1

 
Listener addr: 192.168.1.12

 
Listener addr: ::1

 
no-udp: OFF

 
no-tcp: OFF

 
no-dtls: ON

 
no-tls: ON

  listener
-port: 3478

  tls
-listener-port: 5349

  alt
-listener-port: 0

  alt
-tls-listener-port: 0







 
Relay addr: 192.168.1.12

  server
-relay: OFF (*)

 
no-udp-relay: OFF (*)

 
no-tcp-relay: OFF (*)

  min
-port: 49152

  max
-port: 65535

 
no-multicast-peers: OFF (*)

 
no-loopback-peers: OFF (*)




  DB type
: file

  DB
: turnuserdb.conf




 
Long-term authorization mechanism: OFF

 
Short-term authorization mechanism: OFF

 
Anonymous credentials: OFF

  REST API
: OFF




  total
-quota: 0 (**)

  user
-quota: 0 (**)

  total
-current-allocs: 0

  max
-bps: 0




  cli
-max-output-sessions: 256 (**)




 
(Note 1: params with (*) are togglable)




 
(Note 2: params with (**) are changeable)




>




2) How to implement it on the client side (browser).

> Open the Browser debug logs and check the logs 

Reply all
Reply to author
Forward
0 new messages