The WEBRTC ICE SERVERS can be configured in .env as below.
OPENVIDU_WEBRTC_ICE_SERVERS=[“url=turns:example.turn.com:443,staticAuthSecret=secret”]
But I found we only can use turn:example.turn.com:443 not turns.
I also checked the source code as below, it seems the code only check turn and stun.
public IceServerProperties build() throws IllegalArgumentException {
if (this.ignoreEmptyUrl) {
if (this.staticAuthSecret != null && this.username == null && this.credential == null) {
try {
this.generateTURNCredentials();
return new IceServerProperties(this.url, this.username, this.credential);
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
throw new IllegalArgumentException("Error while generating credentials: " + e.getMessage());
}
} else {
throw new IllegalArgumentException(
"ignoreEmptyUrl=true can only be used with staticAuthSecret defined");
}
}
if (this.url == null) {
throw new IllegalArgumentException("External turn url cannot be null");
}
this.checkValidStunTurn(this.url);
if (this.url.startsWith("turn")) {
if (this.staticAuthSecret != null) {
if (this.username != null || this.credential != null) {
throw new IllegalArgumentException(
"You can't define username or credential if staticAuthSecret is defined");
}
try {
this.generateTURNCredentials();
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
throw new IllegalArgumentException("Error while generating credentials: " + e.getMessage());
}
}
if ((this.username == null || this.credential == null)) {
throw new IllegalArgumentException("Credentials must be defined while using turn");
}
} else if (this.url.startsWith("stun")) {
if (this.username != null || this.credential != null) {
// Credentials can not be defined using stun
throw new IllegalArgumentException("Credentials can not be defined while using stun.");
}
}
return new IceServerProperties(this.url, this.username, this.credential);
}