nowfound

Dev tools · August 1, 2022

HT

How to test whether a STUN/TURN server is working properly

A few days ago, I created a simple service for my WebRTC Project: https://github.com/miroslavpejic85/mirotalk to test if the STUN/TURN servers are working properly. After installing and configuring a STUN/TURN server, most of the developers that are new to this stuff will ask themselves, how do I know if it's working properly? So I made a snippet :) ``` Test Stun/Turn Servers Test Ice Servers The STUN server is NOT reachable! The TURN server is NOT reachable! const Ice = document.getElementById('ice'); const IP = document.getElementById('ip'); const Stun =…

In plain words

This tool tests whether STUN and TURN servers are functioning correctly for WebRTC applications. It is designed for developers who have installed and configured these servers and need to verify they are working properly. The tool provides a simple web-based interface that checks server reachability and displays diagnostic information, helping users troubleshoot connectivity issues without requiring technical expertise in WebRTC infrastructure.

written from the facts on this page · September 2026

From the sources

In the maker’s words, at launch

A few days ago, I created a simple service for my WebRTC Project: https:&#x2F;&#x2F;github.com&#x2F;miroslavpejic85&#x2F;mirotalk to test if the STUN&#x2F;TURN servers are working properly. After installing and configuring a STUN&#x2F;TURN server, most of the developers that are new to this stuff will ask themselves, how do I know if it's working properly? So I made a snippet :) ``` <!DOCTYPE html> <html> <head> <title>Test Stun&#x2F;Turn Servers<&#x2F;title> <meta charset="utf-8" &#x2F;> <meta http-equiv="X-UA-Compatible" content="IE=edge" &#x2F;> <meta name="viewport" content="width=device-width, initial-scale=1.0" &#x2F;> <&#x2F;head> <body> <h1>Test Ice Servers<&#x2F;h1> <hr &#x2F;> <pre id='ice' style='overflow: auto'><&#x2F;pre> <hr &#x2F;> <p id='ip'><&#x2F;p> <p id='stun'> The STUN server is NOT reachable!<&#x2F;p> <p id='turn'> The TURN server is NOT reachable!<&#x2F;p> <p id='err'><&#x2F;p> <hr &#x2F;> <script> const Ice = document.getElementById('ice'); const IP = document.getElementById('ip'); const Stun = document.getElementById('stun'); const Turn = document.getElementById('turn'); const Err = document.getElementById('err'); const iceServers = [ &#x2F;&#x2F; Test some STUN server { urls: 'stun:stun.l.google.com:19302', }, &#x2F;&#x2F; Test some TURN server { urls: 'turn:turnUrl', username: 'turnUsername', credential: 'turnPassword', }, ]; &#x2F;&#x2F; Print iceServers config Ice.innerHTML = JSON.stringify(iceServers, null, 4); &#x2F;&#x2F; Test the connections const pc = new RTCPeerConnection({ iceServers }); pc.onicecandidate = (e) => { if (!e.candidate) return; console.log(e.candidate.candidate); &#x2F;&#x2F; If a srflx candidate was found, notify that the STUN server works! if (e.candidate.type == 'srflx' || e.candidate.candidate.includes('srflx')) { let ip = &#x2F;\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b&#x2F;; let address = e.candidate.address ? e.candidate.address : e.candidate.candidate.match(ip); IP.innerHTML = ' Your Public IP Address is ' + address; Stun.innerHTML = ' The STUN server is reachable!'; } &#x2F;&#x2F; If a relay candidate was found, notify that the TURN server works! if (e.candidate.type == 'relay' || e.candidate.candidate.includes('relay')) { Turn.innerHTML = ' The TURN server is reachable!'; } }; &#x2F;&#x2F; handle error pc.onicecandidateerror = (e) => { console.error(e); Err.innerHTML = ' Error: ' + e.errorText; }; pc.createDataChannel('test'); pc.createOffer().then(offer => pc.setLocalDescription(offer)); <&#x2F;script> <&#x2F;body> <&#x2F;html> ``` Alternative to https:&#x2F;&#x2F;webrtc.github.io&#x2F;samples&#x2F;src&#x2F;content&#x2F;peerconnection&#x2F;... Ref: https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;selfhosted&#x2F;comments&#x2F;wayiev&#x2F;how_to_t... I hope it will be useful to someone.

More dev tools this month

the category →
  • Dograh592

    The open source VAPI alternative

    Dev tools · 25d ago · dograh.com

  • Meridian530

    Don't let your work go unnoticed. Get promoted!

    Dev tools · 20d ago · meridiona.com

  • x1516

    Lovable for iPhone apps go from idea to App Store

    Dev tools · 11d ago · x1.new

  • Open-source GTM skills for technical founders

    Dev tools · 29d ago · gtmcofounder.com

  • OpenTrailPaper is open-source bike computer firmware for the LilyGO T5S3 4.7" E-Paper PRO. It supports offline maps, GPX routes, FIT recording and Bluetooth sensors.

    Dev tools · 2d ago · opentrailpaper.com

  • Nuphos380

    The AI-Native DevOps Workspace.

    Dev tools · 24d ago · nuphos.ai

Launched alongside, August 2022

the whole month →
  • Xnapper1,517

    Take beautiful screenshots instantly

    Work · 2022 · xnapper.com

  • Gamma1,169

    Write like a doc, present like a deck

    Work · 2022 · gamma.app

  • Threado923

    The command center for community builders

    Life & fun · 2022

  • Build remote engineering teams in 24 hours

    Dev tools · 2022 · remotebase.com

  • Convert Figma designs into Flutter 3.0 & React code rapidly

    Dev tools · 2022 · dhiwise.com

  • PA

    Hey HN, I've been working on https:&#x2F;&#x2F;pornpen.ai, a site for generating adult images. Please only visit the site if you are 18+ and willing to look at NSFW images. This site is an experiment using newer text-to-image models. I explicitly removed the ability to specify custom text to avoid harmful imagery from being generated. New tags will be added once the prompt-engineering algorithm is fine-tuned further. If the servers are overloaded, take a look at the feed and search pages to look through past results. For comments&#x2F;suggestions&#x2F;feedback please visit…

    AI · 2022 · pornpen.ai