I am searching how STUN/TURN servers entries defined webrtcendpoint.conf.ini file are used. I basically don't want to hard code the entries on JS side in constraints
and want to define different STUN/TURN for different KMS instances.
So, my understanding is that if I don't define anything in JS, the entries defined in webrtcendpoint.conf.ini get used in
ICE candidates eventually. Is that correct?
STUN/TURN configuration from browser and KMS are not related, unless you make the browser aware of the configuration from your KMS. The content of webrtcendpoint.conf.ini
is only used for the media server to discover it's own ICE candidates. If you don't define STUN/TURN servers for your client, none will be used.
Kurento-utils-js library uses FreeICE if you don't define your own STUN/TURN configuration in your client.
I may be a little bit late to the party, but the correct way to avoid hardcoding your turn credentials into your browser client is to use the TURN REST API. You can read more about it here.
Basically, it allows you to request time-limited credentials using a secret key that is shared between your application server and your TURN server. The logic for this will be implemented in your application server, and you will expose an endpoint for requesting credentials.
You can read a more in depth answer here.