Closed harlanc closed 4 months ago
We take RTMP URL authentication for a example: Now authentication can be only supported using configuration file.
Add authsecret:
[authsecret]
key = "123"
password = "456"
Configure the RTMP protocol:
[rtmp] enabled = true port = 1935 gop_num = 1 [rtmp.auth]
pull_enabled = true
push_enabled = true
algorithm = "simple"
Start the xiu server
./xiu -c config.toml
Simple
The url used for Pushing/Pulling a RTMP stream is as follows(add token={password} as URL query):
rtmp://127.0.0.1:1935/live/test?token=456
Md5
we should add token={md5({key}{stream_name})} as URL query:
md5("123test") = "abe45d28281cfa2a4201c9b90a143095"
so the URL is
rtmp://127.0.0.1:1935/live/test?token=abe45d28281cfa2a4201c9b90a143095
How to Use
We take RTMP URL authentication for a example: Now authentication can be only supported using configuration file.
Configure the configuration file:
Add authsecret:
[authsecret]
used for md5 authentication.
key = "123"
used for simple authentication
password = "456"
Configure the RTMP protocol:
[rtmp] enabled = true port = 1935 gop_num = 1 [rtmp.auth]
playing a RTMP stream requires authorization.(Set it to false or remove this line if not needed)
pull_enabled = true
pushing a RTMP stream requires authorization.(Set it to false or remove this line if not needed)
push_enabled = true
using simple algorithm(or set it to "md5" to use md5 authentication)
algorithm = "simple"
Start the xiu server
./xiu -c config.toml
Algorithm Introduction
Simple
The url used for Pushing/Pulling a RTMP stream is as follows(add token={password} as URL query):
Md5
we should add token={md5({key}{stream_name})} as URL query:
so the URL is