Files
mediamtx/internal/auth/request.go
T
5decbb4a3d Add user agent field to RTMP, RTSP, WebRTC, and HLS (#5753)
Surface user agent in the auth HTTP webhook payload as "userAgent"
and in the API structs for RTMP, RTSP, WebRTC and HLS connections.

---------

Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
2026-06-02 20:29:07 +02:00

34 lines
840 B
Go

package auth
import (
"net"
"github.com/bluenviron/mediamtx/internal/conf"
"github.com/google/uuid"
)
// Protocol is a protocol.
type Protocol string
// protocols.
const (
ProtocolRTSP Protocol = "rtsp"
ProtocolRTMP Protocol = "rtmp"
ProtocolHLS Protocol = "hls"
ProtocolWebRTC Protocol = "webrtc"
ProtocolSRT Protocol = "srt"
)
// Request is an authentication request.
type Request struct {
Action conf.AuthAction
Path string // only for ActionPublish, ActionRead, ActionPlayback
Query string
Protocol Protocol // only for ActionPublish, ActionRead
ID *uuid.UUID // only for ActionPublish, ActionRead
UserAgent string
Credentials *Credentials
IP net.IP
CustomVerifyFunc func(expectedUser string, expectedPass string) bool
}