Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support auth #98

Merged
merged 5 commits into from
Feb 14, 2024
Merged

Support auth #98

merged 5 commits into from
Feb 14, 2024

Conversation

harlanc
Copy link
Owner

@harlanc harlanc commented Feb 10, 2024

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):

     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
    

@harlanc harlanc linked an issue Feb 10, 2024 that may be closed by this pull request
@harlanc harlanc merged commit 99ddb71 into master Feb 14, 2024
1 check passed
@harlanc harlanc deleted the support_auth branch March 2, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add authentication
1 participant