psb
psb

Reputation: 392

ICE candidates gathered only from one network interface

Got very simple code:

<script type="text/javascript">
    pc = new window.RTCPeerConnection();

    pc.onicecandidate = function(event) {
        console.log("onicecandidate\n", event);
    }

    pc.onicegatheringstatechange = function(event) {
        console.log("onicegatheringstatechange\n", event);
    }

    dc = pc.createDataChannel("dataChannel");

    errFunc = function(err) {
        console.log("errFunc\n", err);
    }

    successCback = function() {
        console.log("setLocalDescription is a success\n");
    }

    pc.createOffer()
        .then(function(offer) { pc.setLocalDescription(offer)})
        .then(successCback)
        .catch(errFunc);

</script>

Got ubuntu running chromium and TWO local ethernet interfaces. Running aforementioned code yields only 1 call to onicecandidate and 1 call to onicegatheringstatechange. (any STUN/TURN servers are deliberately not specified, so I do expect only local host candidates, but from all interfaces). Only one ethernet interface is examined by ICE.

Why ?

Upvotes: 1

Views: 1520

Answers (1)

Philipp Hancke
Philipp Hancke

Reputation: 17305

Unless you have permissions for getUserMedia, Chrome will restrict ICE candidates to the interface of the default route. The rationale is explained in this draft

Upvotes: 5

Related Questions