I'm looking at the webrtc.html
and peerconnection_server
demo, and it is working fine between two Chrome browsers. My question is, what exactly is the first param of webkitPeerConnection ?
pc = new webkitPeerConnection("STUN stun.l.google.com:19302", onSignalingMessage);
Is it a third party STUN server given by Google for demo purpose ? If, in my JavaScript code, I replace "stun.l.google.com:19302"
by "toto"
, I'm still able to make video calls. But as I'm on the same subnet, this can be explainable...
STUN provides the mechanism to communicate with users behind a network address translation (NAT) firewall, which keeps their IP addresses private within the local network (LAN). The initiating party sends a request to the STUN server, which maintains the IP addresses of the phone or computer (for video).
STUN stands for Session Traversal Utilities for NAT. It is a standard method of NAT traversal used in WebRTC. It is defined in IETF RFC 5389. It is one of two NAT traversal servers that are used in WebRTC (the other one is TURN).
STUN tells a client its public IP so that client can in turn communicate its IP to the other participating client. Assuming both clients can route to the other's discovered IP address and port directly, communication is established with direct UDP sockets.
Session Traversal of User Datagram Protocol through Network address translator(STUN) is a protocol used by VoIP utilities for communication between the machines hidden behind a NAT gateways. STUN is a client server protocol.
STUN servers are used by both clients to determine their IP address as visible by the global Internet.If both the peers are behind the same NAT , STUN settings are not needed since they are anyways reachable form each other . STUN effectively comes into play when the peers are on different networks.
As we know that webRTC is peer to peer and the ice candidates are mandatory in webrtc. ICE functionality can be in any of the two ways , STUN and TURN .
There are many stun servers provided by google and other sites which one could use . You can also setup your own STUn server according to rfc5766.
Hope that gives a zest of what and how of stun .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With