Eric Stotch
Eric Stotch

Reputation: 241

How to get WebRTC to connect to peers?

I'm a little confused. On this MDN page it says the following (emphasis mine) https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/icecandidate_event

An icecandidate event is sent to an RTCPeerConnection when an RTCIceCandidate has been added to the target as a result of calling RTCPeerConnection.setLocalDescription(). This event handler should transmit the candidate to the remote peer so that the remote peer can add it its set of remote candidates.

The only example I could find that uses a STUN server is webrtc/samples trickle-ice https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/. My STUN server appears to work.

It will list my tcp and udp ports. However when I have IceTransports value set to relay I always get an empty list

If I want three users to visit my page and talk to eachother using RTCDataChannel how do they detect and connect to eachother?

Upvotes: 0

Views: 248

Answers (1)

Philipp Hancke
Philipp Hancke

Reputation: 17295

You need a signaling server to exchange the offer, answer and candidates. A STUN servers is not a signaling server, its only purpose is to find out your own public IP address.

Upvotes: 0

Related Questions