Skip to content

Commit

Permalink
Allow use of rtmp_noauth
Browse files Browse the repository at this point in the history
Useful for reverse-proxied configurations that handle authentication themselves (see nginx-rtmp-module).
  • Loading branch information
EssGeeEich authored Jan 14, 2021
1 parent e04f6fb commit ba3c832
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions protocol/rtmp/rtmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ func (s *Server) handleConn(conn *core.Conn) error {

log.Debugf("handleConn: IsPublisher=%v", connServer.IsPublisher())
if connServer.IsPublisher() {
if configure.Config.GetBool("rtmp_noauth") {
key, err := configure.RoomKeys.GetKey(name)
if err != nil {
err := fmt.Errorf("Cannot create key err=%s", err.Error())
conn.Close()
log.Error("GetKey err: ", err)
return err
}
name = key
}
channel, err := configure.RoomKeys.GetChannel(name)
if err != nil {
err := fmt.Errorf("invalid key err=%s", err.Error())
Expand Down

0 comments on commit ba3c832

Please sign in to comment.