On server startup the configuration files are loaded as normal. NATS is connected first and if enabled, additional configuration is loaded with a NATS request. This makes it possible to provide additional configuration from other services. NATS configuration is only loaded on startup. So whenever the NATS configuration provider changes the webrtc configuration, it has to trigger a restart of Spreed WebRTC externally.
For backwards compatibility we return the first in list TURN server directly. This allows clients which do not implement any selection still use TURN and lets the TURN service control which one it should be (first in list is used).
To provide peer to peer support for users with a firewall, a TURN
service might be required. Not everyone can/wants to setup a self-hosted
TURN server. This change adds support to consume a remote TURN service
which usually requires authentication. Spreed WebRTC received TURN
credentials using this service in regular intervals and provides them to
all Spreed WebRTC sessions.
If the remote TURN service provides multiple zones and a GEO location
endpoint, the web client will also directly connect to that TURN service
GEO endpoint to let the TURN service select preferred zones based on the
clients information.
The advanced settings provide a way to control the TURN service zone
directly and to disable the client side GEO call. By default the
selection is auto if the TURN service provides a GEO endpoint. If no
such endpoint is required, the zone with the highest priority is used by
default (as sent by the TURN credentials service).
To allow muliple plugins, sorted plugin load and general extensibility
of the web client, the server now supports to load an extra.d folder on
startup.
Sub folders inside extra.d, are loaded in alphabetic order and searched
for head.html and body.html, making it possible to append additional
html code into the <head> and <body> elements for the web client.
Example:
```
extra.d/
└── my-plugin
├── body.html
├── head.html
└── static
├── css
│ └── my-plugin.css
└── js
└── my-plugin.js
```
Example head.html:
```
<link rel="stylesheet" href="<%.S%>/css/my-plugin.css">
```
Example body.html:
```
<script data-plugin="<%.S%>/js/my-plugin.js"></script>
```
This makes it possible to extend the web client with additional
components and/or overwrite existing.
Previously, each user broadcasted the status after a "Room" event was
received. This caused a short time for all other participants where
the buddy list showed "Participant X" instead of the real user name.
The session ids contain a Gorilla SecureCookie which internally encodes
"timestamp|value". As a result, newer session ids compare "greater"
than older ids. This is a problem for conferences where the participants
decide based on comparison of the session id who calls who, so later
participants always have to call all of the existing participants.
With this change, the (random) value is at the start of the session id,
resulting in "random" ordering of participants. Also some tests have
been added to check session en-/decoding.