diff --git a/src/app/channel/media/queue.js b/src/app/channel/media/queue.js index fc8de01..0a5ebaa 100644 --- a/src/app/channel/media/queue.js +++ b/src/app/channel/media/queue.js @@ -473,12 +473,16 @@ class queue{ //Seriously, to watch a deeply important puzzle piece of modern infrastructure get TURNed into LLM-Slop is just depressing //At least I get to make puns about it - //Create token from server shared secret and username - const token = crypto.createHmac('sha1', `${server.secret}${user}`); + //Create token from server shared secret + const token = crypto.createHmac('sha1', server.secret); + + //Add pre-calculated username value to token (doesn't work when added to string at token creation) + token.update(user); //Hash token string and save it in base64 const hash = token.digest('base64'); + //Add TURN(S) server to ICEConfig iceServers.push({ urls: server.urls, username: user, @@ -486,6 +490,7 @@ class queue{ }) } + //return ice config return iceServers; } @@ -2018,4 +2023,4 @@ class queue{ } } -module.exports = queue; \ No newline at end of file +module.exports = queue;