Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sweng-group-15
signalbuddy
Commits
216be42b
Commit
216be42b
authored
Jan 06, 2020
by
Moritz Langenstein
Browse files
(ml5717) Fixed TURN server username for UUIDs
parent
1e44fad4
Changes
2
Hide whitespace changes
Inline
Side-by-side
dist/sockets.js
View file @
216be42b
...
...
@@ -144,7 +144,7 @@ function signalbuddy(server, config) {
function
getTurnServers
(
username
)
{
// See https://github.com/coturn/coturn/wiki/turnserver#turn-rest-api for details
var
acting_ice_turn_username
=
Math
.
floor
(
Date
.
now
()
/
1000
)
+
config
.
ice
.
turn
.
timeout
+
"
-
"
+
username
;
var
acting_ice_turn_username
=
Math
.
floor
(
Date
.
now
()
/
1000
)
+
config
.
ice
.
turn
.
timeout
+
"
-
"
+
username
.
replace
(
/-/g
,
""
)
;
var
acting_ice_turn_password
=
_crypto2
.
default
.
createHmac
(
'
sha1
'
,
config
.
ice
.
turn
.
secret
).
update
(
acting_ice_turn_username
).
digest
(
'
base64
'
);
return
[(
0
,
_normalice2
.
default
)(
'
turn:
'
+
acting_ice_turn_username
+
'
:
'
+
acting_ice_turn_password
+
'
@
'
+
config
.
ice
.
host
+
'
:
'
+
config
.
ice
.
port
)];
...
...
src/sockets.js
View file @
216be42b
...
...
@@ -126,7 +126,7 @@ function signalbuddy(server, config) {
function
getTurnServers
(
username
)
{
// See https://github.com/coturn/coturn/wiki/turnserver#turn-rest-api for details
const
acting_ice_turn_username
=
(
Math
.
floor
(
Date
.
now
()
/
1000
)
+
config
.
ice
.
turn
.
timeout
)
+
"
-
"
+
username
const
acting_ice_turn_username
=
(
Math
.
floor
(
Date
.
now
()
/
1000
)
+
config
.
ice
.
turn
.
timeout
)
+
"
-
"
+
username
.
replace
(
/-/g
,
""
)
const
acting_ice_turn_password
=
crypto
.
createHmac
(
'
sha1
'
,
config
.
ice
.
turn
.
secret
).
update
(
acting_ice_turn_username
).
digest
(
'
base64
'
)
return
[
normalice
(
`turn:
${
acting_ice_turn_username
}
:
${
acting_ice_turn_password
}
@
${
config
.
ice
.
host
}
:
${
config
.
ice
.
port
}
`
)]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment