EricssonResearch / openwebrtc

A cross-platform WebRTC client framework based on GStreamer
http://www.openwebrtc.org
BSD 2-Clause "Simplified" License
1.8k stars 537 forks source link

STUN and TURN domain resolution #39

Closed stefanalund closed 10 years ago

stefanalund commented 10 years ago

libnice does not support domain name resolution, meaning that web apps need to provide IP addresses when configuring STUN/TURN in PeerConnections:

var configuration = { "iceServers": [{ "url": "stun:132.177.123.6" }] };
pc = new webkitRTCPeerConnection(configuration);

This is cannot be solved in OpenWebRTC, only in libnice itself.

alessandrod commented 10 years ago

I have a patch for libnice to enable name resolution, but since it seems to be intentionally disabled i'm trying to get in touch with the libnice devs to ask why that's the case.

stefanalund commented 10 years ago

Thanks @alessandrod, sounds good.

superdump commented 10 years ago

We landed @alessandrod 's patch against libnice to do name resolution synchronously. This can cause significant delays in call startup time while the STUN server address is resolved.

I talked to Olivier and Youness and the conclusion seemed to be that using GResolver for an asynchronous API is a good idea but also that in order to avoid additional call startup time waiting for DNS, we should resolve the address at some point before the call is started and set the IP address on nice instead of implementing the resolution in nice.

sdroege commented 10 years ago

Problem with that is that @alessandrod observed that the hostname seems to be part of the ice messages and some servers reject if there is only the ip

superdump commented 10 years ago

@pererikb has a GResolver patch here: https://github.com/pererikb/openwebrtc/commit/e7a269317c8ae8277342e956b2f55c7a4d263cdb

But as @sdroege and @alessandrod noted, it won't work for the STUN servers that require the hostname to be in the ICE/STUN messages.

stefanalund commented 10 years ago

Fixed.