Flussonic Media Server documentation

Using the IPTV Plugin with Stalker (or Any Other HTTP Backend)

Intro Anchor Anchor x2

Sometimes you need to use multiple authentication backends, for example Stalker + Flussonic IPTV Plugin.

IPTV Plugin is a special case of authorization backend. You should to configure multiauth to work with two backends.

IPTV Plugin + Stalker Anchor Anchor x2

IPTV plugin is a auth backend with the URL:

There is an lua example:

function convert_reply(reply)
  if reply.code == 200 then
    t = {}
    if reply.headers["x-authduration"] then
      t["auth_time"] = tonumber(reply.headers["x-authduration"])
    if reply.headers["x-max-sessions"] then
      t["max_sessions"] = tonumber(reply.headers["x-max-sessions"])
    if reply.headers["x-userid"] then
      t["user_id"] = reply.headers["x-userid"]
    return true, t
    return false,{["code"] = reply.code}

reply1 = http.get(""..http.qs_encode(req))

status1, headers1 = convert_reply(reply1)
if status1 then
  return status1, headers1

reply2 = http.get("http://<HOST:PORT>/stalker_portal/server/api/chk_flussonic_tmp_link.php?"..http.qs_encode(req))

status2, headers2 = convert_reply(reply2)

return status2, headers2

Save this code to the file: /etc/flussonic/auth.lua and then configure Flussonic to auth via lua file.


#Global settings:
http 80;
auth /etc/flussonic/auth.lua;

# Streams