Browse Source

Allow use of rtmp_noauth

Useful for reverse-proxied configurations that handle authentication themselves (see nginx-rtmp-module).
pull/152/head
Mauro 4 years ago committed by GitHub
parent
commit
ba3c83263a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      protocol/rtmp/rtmp.go

10
protocol/rtmp/rtmp.go

@ -122,6 +122,16 @@ func (s *Server) handleConn(conn *core.Conn) error { @@ -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())

Loading…
Cancel
Save