Skip to content

Instantly share code, notes, and snippets.

View qruf's full-sized avatar

qruf qruf

  • Nice Boys & Sons
View GitHub Profile
@qruf
qruf / auth.lua
Created May 15, 2017 23:25 — forked from fur-q/auth.lua
nginx rtmp/hls server setup
-- add users:
-- $ htpasswd -s -c /etc/nginx-rtmp/.htpasswd streamname
-- stream:
-- $ ffmpeg -i foo.mp4 -c copy -f flv rtmp://abc.de/streamname?auth=password
local users = {}
for line in io.lines("/etc/nginx-rtmp/.htpasswd") do
local user, pass = line:match("([^:]+):{SHA}([^\n]+)")
users[user] = pass
end