WebRTC STUN/TURN Config Builder
Visually add STUN/TURN servers and ICE options, then generate ready-to-use RTCConfiguration JavaScript code and a JSON config file.
FreeOnline Tool
Loading…
How to Use
- In the STUN Servers section, add STUN URLs manually or click the Google/Twilio/Cloudflare/Metered/FreeSWITCH preset tags to add them instantly (a Google STUN entry is included by default).
- In the TURN Servers section, click "+ Add TURN" and fill in the URL, username, password, and credential type (password or oauth).
- Set ICE options: transport policy (all vs. relay-only), candidate pool size, and ICE gathering timeout.
- Click "Generate Config" to get JavaScript code (RTCPeerConnection setup + onicecandidate listener) and the equivalent JSON configuration.
- Click "Export JSON File" to download the config as webrtc-ice-config.json, or use the individual "Copy" buttons for the JS or JSON.
- Click "Load Sample Data" for a worked example with two STUN servers and one authenticated TURN server.
Features
- Add or remove any number of STUN and TURN server entries through a visual form.
- Five one-click presets for common free/public STUN servers (Google, Twilio, Cloudflare, Metered, FreeSWITCH), with automatic duplicate prevention.
- TURN servers support username, password, and credential type (password/oauth) fields.
- Advanced ICE options: iceTransportPolicy (all/relay), iceCandidatePoolSize, and a configurable ICE gathering timeout.
- Produces two outputs at once: paste-ready JavaScript (RTCPeerConnection init + ICE candidate listener + gathering-timeout handling) and standard RTCConfiguration JSON.
- One-click copy for either output, or download the JSON straight to a .json file.
- Generates configuration only — it does not open a real WebRTC connection or verify that any server is actually reachable.
Use Cases
Bootstrap ICE config for a new WebRTC project
Starting a video call or P2P data-channel project and don't want to hand-write the iceServers array syntax — fill in your servers and get working code immediately.
Compare free STUN providers
Use the preset tags to quickly stack Google, Cloudflare, and Twilio STUN endpoints as fallbacks, then export the JSON straight into a front-end or back-end config file.
Wire up credentials for a self-hosted TURN server
After standing up coturn or similar, you need an iceServers entry with a username/password — build it through the form instead of hand-escaping quotes in a JSON literal.
Test relay-only mode while debugging NAT traversal
Suspect STUN alone can't traverse a symmetric NAT — switch iceTransportPolicy to relay to force TURN relay and regenerate the config to test connectivity.
FAQ
Does this tool actually open a WebRTC connection to test my servers?
No. It only assembles JavaScript and JSON text locally in your browser — no network requests are made, and the STUN/TURN addresses you enter are never validated for reachability.
Is my TURN password sent anywhere?
No. Everything happens client-side in your browser; the form data is never sent to any backend.
Are the preset STUN addresses free, and can I use them in production?
The Google/Twilio/Cloudflare presets are publicly offered free STUN services with their own availability and rate-limit terms — evaluate them yourself for production use. TURN (relay) generally still requires self-hosting or a paid provider.
What do candidatePoolSize and the ICE gathering timeout actually do?
iceCandidatePoolSize pre-gathers ICE candidates to speed up connection setup. The gathering timeout is a setTimeout snippet included in the generated code that proceeds with whatever candidates have been collected if gathering takes too long — it is not a native browser API parameter.