Search code examples
realmwebrtccoturn

Providing multiple realms/origins to coTurn from webRTC client


As coTurn server provides the option to create multiple realms throught its database, and when turning the server on, a default realm can be provided in the configuration.

When configuring the webRTC client to access TURN, it only allows the URIs, username and credentials properties, but does not have any way to provide a realm or origin (as coturn supports origin).

The default realm is always considered.

If I try to utilize the realms concepts, providing different user credentials under different realms in the webRTC client config, the server accepts only turn requests with users under the default realm.

Questions

  • Is there a way to overcome this matter to provide realms/origin to the server?

  • If not, why have realms been added to the coturn if they cannot be used?


Solution

  • tl;dr: the realm is pretty useless in WebRTC.

    In theory TURN as a protocol includes a realm. However, see the detailed example in the RFC this typically isn't sent in the initial allocate request, only subsequent ones. In theory the client could store the realm and use it for subsequent requests. In WebRTC, the peerconnections are pretty much independent. There is no way to configure the realm in the ICE server configuration See also this response from working on that in chrome/webrtc.org