Video Chat app
You may need a TURN server and to create a certificate for it:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
Use this technique for coturn password:
private getTURNCredentials(name:string, secret:string):{username:string,password:string} {
var unixTimeStamp:Number = Math.round(Date.now()/1000) + 24*3600, // this credential would be valid for the next 24 hours
username:string = [unixTimeStamp, name].join(':'), password:string,
hmac = crypto.createHmac('sha1', secret);
hmac.setEncoding('base64');
hmac.write(username);
hmac.end();
password = hmac.read();
return {
username: username,
password: password
};
}
You can find more WebRTC good explanations in this article.