Skip to content
Realtime communication in the browser!
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Tutorials used:

Other tutorials found

Definition of STUN/SERVER

A STUN/TURN server is used for NAT traversal in VoIP. Whether you're at home behind a common router, at work behind an enterprise firewall, or traveling, chances are that you will be behind a NAT which must be traversed before making calls. [source: Viagénie]

If a STUN server doesn’t work, then WebRTC will try the next server, which is why you should add several. But using more than two STUN/TURN servers slows down discovery. STUN servers are cheaper than TURN servers, which is why Google and Firefox allow anyone to access their STUN servers for free. TURN servers are harder to find for free, but they do exist. [sources: websitebeaver, Bugzilla]

Servers used in this app

simple-peer provides by default two STUN server:

config: {
  iceServers: [
    { urls: '' },
    { urls: '' },

Mozilla provides another free STUN server : {urls: ''}

Viagénie provides a free TURN server:

{urls: '','credential': '****','username': '****'}

So my final config is as follows:

config: {
  iceServers: [
    { urls: '' },
    { urls: '' },
    { urls: '' },
    { urls: '', credential: '****', username: '****' },

Paid service provided by Twilio:

WebRTC in real world apps:

  • Google Allo
  • Goole Duo
You can’t perform that action at this time.