Flussonic Media Server documentation

Trivial key server

Here goes an example of most primitive key server for AES-128 or SAMPLE-AES:

cas-server.php:

<?php
  header("HTTP/1.0 200 OK");
  $resource = $_GET["file"];
  $number = $_GET["number"];
  error_log("Server is requesting key ".$number." for ".$resource." from ".$_SERVER["REMOTE_ADDR"]);
  header("X-Key-Url: http://".$_SERVER["HTTP_HOST"]."/user-key.php?name=".$resource."&number=".$number);

  $input = $resource.".".$number;
  $key = hash('md4',$input);
  header("Content-Length: ".strlen($key));
  echo $key;
?>

user-key.php:

<?php
  header("HTTP/1.0 200 OK");
  $resource = $_GET["name"];
  $number = $_GET["number"];

  $input = $resource.".".$number;
  $key = hex2bin(hash('md4',$input));
  header("Content-Length: ".strlen($key));
  header("Content-Type: application/octet-stream");
  error_log("User is requesting key ".$number." for ".$resource." from ".$_SERVER["REMOTE_ADDR"]);
  echo $key;
?>

Place these files into web-server directory. "cas-server.php" must be accessible for Flussonic, "user-key.php" must be accessible for clients.

Configure DRM for stream in the following way:

stream ort {
  url udp://239.0.0.1:1234;
  hds off;
  rtmp off;
  rtsp off;
  dash off;
  mpegts off;
  drm aes128 keyserver=http://192.168.0.80:4500/cas-server.php;
}

where http://192.168.0.80:4500/cas-server.php is an url of PHP script above.

Flussonic will rotate keys once per 10 minutes.