I am trying to figure out how to test whether a STUN/TURN server is alive and properly responding to connections. Ideally this test would be performed from an external machine, just in case the STUN/TURN machine is down for this case should also be reported by the connectivity test.
Has anyone looked into this case in the past? What solutions would be recommended?
Edit: A nice implementation in github.io taken from comment to another answer( choose "relay" in IceTransports value):
Test TURN Server
following Benjamin Trent's advice, I wrote the below code to test TURN server's connectivity, works on both firefox n chrome:
example usage:
You can run the below snippet to check:
If you want to check the stun server constantly you can execute this command with cron :
Replace root@localhost with your email to get the report.
stunserver=stun1.l.google.com;
stunport=19302;
listenport=20000; # Change freely this port if not available
Add it to cron and execute it every minute.
Test your TURN and STUN servers here
If you are open for a commercial tool for high load testing of turn servers like 100,000 virtual users or 1 million virtual users, you may like to check Load Multiplier tool (www.loadmultiplier.com). Also a specific page how to test coturn server is covered here.
Please note that either Load Multiplier tool will simulate a dummy signalling plane (to exchange the SDP between clients). And you can test STUN, TURN and ICE with SRTP / DTLS media.
You could set up a 3rd party monitoring service (we use Monitis) or even your own machine to PING the server every minute from 1 or more locations. However this will only tell you if the server is reachable and not necessarily if the TURN/STUN application server still accepts & responds to TURN/STUN packets.
A server side monitoring library for STUN/TURN would make a great GitHub project.
Version of @mido function to check the TURN and the STUN server both (original rejects stun-servers):