How To Establish Peer Connection In Web App Using Coturn (stun/turn) Server
Solution 1:
I think you are bit confused, coturn
is not a signalling server, it is a TURN/ STUN server.
Signalling server is something though which you exchange sdp, ice candidates and other data between the peers before they get a direct peer to peer connection, coturn
does not do that.
I cannot explain all the bits, but gist is STUN is used for providing public IP of a peer, and TURN is used for a proxy point for transmitting and receving data from a peer when it cannot be directly accessed, and in most cases all you require is a STUN server. The only time they get involved in your WebRTC application is when you create the PeerConnection
object, you pass the STUN/TURN server details in the config object, example:
let pc = new RTCPeerConnection({
"iceServers": [
{"urls": "stun:example.com"}, // STUN Server address
{"urls": "turn:example.com", "credential": "test", "username": "test"} // TURN Server address
]
});
Solution 2:
So as I understand I will not need to use coturn, just one signalling server like SignalMaster or any other like it. Am I wrong?
You still might need coTurn or any other STUN/TURN server to achieve peer-to-peer or relay connection when host-host connection is not possible. STUN/TURN is required for ICE to have server-reflexive and relayed candidates to perform ICE and guarantee the connectivity.
WebRTC works as offer-answer model, so you need some kind of signalling method like SIP/Jingle or another signalling mechanism to exchange the SDP between two party. You may use some third party solution above of WebRTC implementation or you can write your own simple signalling stack.
Post a Comment for "How To Establish Peer Connection In Web App Using Coturn (stun/turn) Server"