Fixed bug with authentication for external TURN(S) servers
This commit is contained in:
parent
a11fec6240
commit
0968a5eba6
1 changed files with 8 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue