configure WebRTC stack to make use of TURN candidates only

672 views
Skip to first unread message

Rajmohan Banavi

unread,
Apr 27, 2013, 3:36:37 AM4/27/13
to discuss...@googlegroups.com
Is it possible to configure the WebRTC stack to make use of TURN candidates only when creating peer connections?

Thanks.
Rajmohan

Philipp Hancke

unread,
May 1, 2013, 3:41:56 AM5/1/13
to discuss...@googlegroups.com
Not yet, see issue #1179


--
 
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rajmohan Banavi

unread,
May 1, 2013, 1:31:52 PM5/1/13
to discuss...@googlegroups.com
Thanks philipp. Is it possible to drop the other candidates (host and server reflexive) after candidate gathering is done in the JS code programmatically?

Vikas

unread,
May 1, 2013, 6:48:22 PM5/1/13
to discuss-webrtc
Hi,

I think you can pass only relay candidates to addIceCandidate() when
the onicecandidate callback is fired. Something like below :-

function iceCallback1(event){
if (event.candidate.candidate.search('relay')>0) {
pc2.addIceCandidate(new RTCIceCandidate(event.candidate));
trace("Local ICE candidate: \n" + event.candidate.candidate);
}
}

/Vikas

On May 1, 10:31 am, Rajmohan Banavi <rajmohanban...@gmail.com> wrote:
> Thanks philipp. Is it possible to drop the other candidates (host and
> server reflexive) after candidate gathering is done in the JS code
> programmatically?
>
> On Wed, May 1, 2013 at 1:11 PM, Philipp Hancke <
>
>
>
>
>
>
>
> philipp.han...@googlemail.com> wrote:
> > Not yet, see issue #1179
>
> > On Sat, Apr 27, 2013 at 9:36 AM, Rajmohan Banavi <rajmohanban...@gmail.com
> > > wrote:
>
> >> Is it possible to configure the WebRTC stack to make use of TURN
> >> candidates only when creating peer connections?
>
> >> Thanks.
> >> Rajmohan
>
> >>  --
>
> >> ---
> >> You received this message because you are subscribed to the Google Groups
> >> "discuss-webrtc" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an
> >> email to discuss-webrt...@googlegroups.com.
> >> For more options, visithttps://groups.google.com/groups/opt_out.

Philipp Hancke

unread,
May 2, 2013, 1:13:15 AM5/2/13
to discuss...@googlegroups.com
On Wed, May 1, 2013 at 7:31 PM, Rajmohan Banavi <rajmoha...@gmail.com> wrote:
Thanks philipp. Is it possible to drop the other candidates (host and server reflexive) after candidate gathering is done in the JS code programmatically?

If you don't trickle you need to remove the a=candidate: lines from the peerconnections localdescription before sending it. See extractSDP and removeCN in the apprtc sample, basically it's a simple string replace.

Anders Both

unread,
May 6, 2013, 2:38:40 PM5/6/13
to discuss...@googlegroups.com, philipp...@googlemail.com
Hi Thread.

Did someone here succesfully made a WebRTC demo always and only use turn, by dropping non-relay candidates?

I dont understand Philipps last post with "If you don't trickle you need to remove the a=candidate" ?

Best regards,

Anders Both
Denmark.

Adam Fineberg

unread,
May 6, 2013, 4:25:02 PM5/6/13
to discuss...@googlegroups.com
Yes, this works, we use it for testing.

If using trickle ice, the candidates come in one at a time (separate messages from the sdp) and you can drop the ones that aren't turn.  As Philipp mentioned, if there is not trickle ice, then the candidates come in the sdp rather than in separate messages and you would need to parse the sdp to remove the embedded candidate messages.  Just remember that you would need to do this for all sections of the sdp as there can be separate candidates for audio and video.

Regards,
Adam
--
 
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Regards,
Adam

Anders Both

unread,
May 6, 2013, 5:01:17 PM5/6/13
to discuss...@googlegroups.com
Thanks!. Sounds doable - I will try this tommorow.


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/v2tn0SwcVvo/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.

Rajmohan Banavi

unread,
May 6, 2013, 6:30:20 PM5/6/13
to discuss...@googlegroups.com
Is trickle ice enabled by default in chrome? how can one enable or disable the same in chrome?

Further in the apprtc example, when the signaling message is of type "candidate", then does it mean that the trickle ice is being used? And it is being communicated separately from offer & answer?

BTW, I tried the method suggested by Vikas and it does work for me.

Thanks,
Rajmohan
Life is here and now, not yesterday, not tomorrow...!

Adam Fineberg

unread,
May 6, 2013, 6:38:34 PM5/6/13
to discuss...@googlegroups.com
Yes, Chrome does trickle ICE by default.  Last I checked Firefox was not doing trickle ICE hence to interop you need to handle both.

Regards,
Adam

Anders Both

unread,
May 9, 2013, 2:21:48 PM5/9/13
to discuss...@googlegroups.com
The method is working for me as well.

When a candiate arrives from the other peer, I do
  var s = JSON.stringify(msg.candidate);
                    if (s.indexOf("relay") == -1) {
                        console.log("Stun candidate ignored: " + s);
                        return;
                    }

I wonder now if somehow a similar method can be used to determine, from javascript, if a client is currently doing relay or p2p (turn or stun).

Vikas

unread,
May 9, 2013, 7:10:08 PM5/9/13
to discuss-webrtc
Hi,

AFAIK, currently no method available to tell what ice candidates
browser picked. I think in future this will be surfaced through
getStats api. See this thread :-
https://groups.google.com/group/discuss-webrtc/browse_thread/thread/b41a2df9565a0e6e/f87c2ccb82fbf9c2?lnk=gst

/Vikas

Justin Uberti

unread,
May 10, 2013, 3:56:20 PM5/10/13
to discuss-webrtc
An initial version of ICE information in getStats should be landing on canary in the next few days.


Reply all
Reply to author
Forward
0 new messages