mirror of
https://github.com/eliasstepanik/vdo.ninja.git
synced 2026-01-11 21:58:35 +00:00
index.html added a two config-lines that can simply be uncommented for activating the "twilio-mode" or the "php-credentials-mode" turn-credentials.php (new file) will generate username and password for a turn server with a static-auth-secret and will offer it in json-format main.js added a section that requests output from php-credentials.php and adds the username, password, stun-server and turn-server into the configuration
11 lines
454 B
PHP
11 lines
454 B
PHP
<?php
|
|
$stun_server = "stun:<stun-server>:<stun-port>";
|
|
$turn_server = "turns:<turn-server>:<https-turn-port>";
|
|
$turn_expiry = 86400;
|
|
$turn_username = time() + $turn_expiry;
|
|
$turn_secret = '<turn-server static-auth-secret>';
|
|
$turn_password = base64_encode ( hash_hmac ( 'sha1', $turn_username, $turn_secret, true ) );
|
|
|
|
$arr = array('1' => $turn_username, '2' => $turn_password, '3' => $stun_server, '4' => $turn_server);
|
|
echo json_encode($arr);
|
|
?>
|