config

package
v1.13.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 24 Imported by: 13

Documentation

Index

Constants

View Source
const (

	// TURNMaxTTLSeconds is the operational maximum for TURN credential TTLs (24 hours).
	// It bounds credential lifetime and prevents time.Duration overflow when multiplying
	// by time.Second (values above ~9.2e9 seconds wrap on 64-bit builds).
	TURNMaxTTLSeconds = 24 * 60 * 60

	// DefaultTURNTTLSeconds is the default TTL for embedded TURN credentials, and the
	// fallback used when a configured TTL is <= 0.
	DefaultTURNTTLSeconds = 300

	// DefaultExternalTURNTTLSeconds is the default TTL applied to external TURN
	// (static-auth-secret) credentials when the configured TTL is left at 0.
	DefaultExternalTURNTTLSeconds = 14400

	// DefaultTURNPerUserRelayAllocationLimit bounds how many concurrent relay
	// allocations a single participant credential may hold on the embedded TURN
	// server. It prevents one authenticated participant from exhausting the
	// shared relay-port range for everyone else. A value <= 0 disables the quota.
	DefaultTURNPerUserRelayAllocationLimit = 12
)

Variables

View Source
var (
	ErrKeyFileIncorrectPermission        = errors.New("key file others permissions must be set to 0")
	ErrTURNSecretFileIncorrectPermission = errors.New("turn secret file others permissions must be set to 0")
	ErrKeysNotSet                        = errors.New("one of key-file or keys must be provided")
	ErrTURNSecretEmpty                   = errors.New("turn secret is empty")
	ErrTURNServerNoCredentials           = errors.New("turn server has no usable credentials: set a non-empty secret/secret_file for dynamic auth, or username and credential for static auth")
)
View Source
var DefaultConfig = Config{
	Port: 7880,
	RTC: RTCConfig{
		RTCConfig: rtcconfig.RTCConfig{
			UseExternalIP:     false,
			TCPPort:           7881,
			ICEPortRangeStart: 0,
			ICEPortRangeEnd:   0,
			STUNServers:       []string{},
		},
		PacketBufferSize:                  500,
		PacketBufferSizeVideo:             500,
		PacketBufferSizeAudio:             200,
		PLIThrottle:                       sfu.DefaultPLIThrottleConfig,
		DatachannelDataTrackTargetLatency: 100 * time.Millisecond,
		CongestionControl: CongestionControlConfig{
			Enabled:                   true,
			AllowPause:                false,
			StreamAllocator:           streamallocator.DefaultStreamAllocatorConfig,
			RemoteBWE:                 remotebwe.DefaultRemoteBWEConfig,
			UseSendSideBWEInterceptor: false,
			UseSendSideBWE:            false,
			SendSideBWEPacer:          string(pacer.PacerBehaviorNoQueue),
			SendSideBWE:               sendsidebwe.DefaultSendSideBWEConfig,
		},
	},
	Audio: sfu.DefaultAudioConfig,
	Video: VideoConfig{
		DynacastPauseDelay:       5 * time.Second,
		StreamTrackerManager:     sfu.DefaultStreamTrackerManagerConfig,
		CodecRegressionThreshold: 5,
	},
	Redis: redisLiveKit.RedisConfig{},
	Room: RoomConfig{
		AutoCreate: true,
		EnabledCodecs: []CodecSpec{
			{Mime: mime.MimeTypePCMU.String()},
			{Mime: mime.MimeTypePCMA.String()},
			{Mime: mime.MimeTypeOpus.String()},
			{Mime: mime.MimeTypeRED.String()},
			{Mime: mime.MimeTypeVP8.String()},
			{Mime: mime.MimeTypeH264.String()},
			{Mime: mime.MimeTypeVP9.String()},
			{Mime: mime.MimeTypeAV1.String()},
			{Mime: mime.MimeTypeH265.String()},
			{Mime: mime.MimeTypeRTX.String()},
		},
		EmptyTimeout:          5 * 60,
		DepartureTimeout:      20,
		CreateRoomTimeout:     10 * time.Second,
		CreateRoomAttempts:    3,
		UpdateBatchTargetSize: 128 * 1024,
	},
	Limit: LimitConfig{
		MaxMetadataSize:                  512 * 1024,
		MaxAttributesSize:                64 * 1024,
		MaxRoomNameLength:                256,
		MaxParticipantIdentityLength:     256,
		MaxParticipantNameLength:         256,
		MaxDataBlobKeyLength:             256,
		MaxDataBlobSize:                  64000,
		MaxDataTrackCustomEncodingLength: 32,
		SignalMessageSizeLimit:           2 << 20,
		AgentSignalMessageSizeLimit:      2 << 20,
		MaxAPIRequestBodySize:            10 << 20,
	},
	Logging: LoggingConfig{
		PionLevel: "error",
	},
	TURN: TURNConfig{
		Enabled:                     false,
		BindAddresses:               []string{"0.0.0.0"},
		TTLSeconds:                  DefaultTURNTTLSeconds,
		PerUserRelayAllocationLimit: DefaultTURNPerUserRelayAllocationLimit,
	},
	NodeSelector: NodeSelectorConfig{
		Kind:         "any",
		SortBy:       "random",
		SysloadLimit: 0.9,
		CPULoadLimit: 0.9,
		Algorithm:    "lowest",
	},
	SignalRelay: SignalRelayConfig{
		RetryTimeout:     7500 * time.Millisecond,
		MinRetryInterval: 500 * time.Millisecond,
		MaxRetryInterval: 4 * time.Second,
		StreamBufferSize: 1000,
		ConnectAttempts:  3,
	},
	Agents: agent.Config{
		TargetLoad: agent.DefaultTargetLoad,
	},
	PSRPC:            rpc.DefaultPSRPCConfig,
	Keys:             map[string]string{},
	Metric:           metric.DefaultMetricConfig,
	WebHook:          webhook.DefaultWebHookConfig,
	NodeStats:        DefaultNodeStatsConfig,
	API:              DefaultAPIConfig(),
	EnableDataTracks: true,
}
View Source
var DefaultNodeStatsConfig = NodeStatsConfig{
	StatsUpdateInterval:           2 * time.Second,
	StatsRateMeasurementIntervals: []time.Duration{10 * time.Second},
	StatsMaxDelay:                 30 * time.Second,
}

Functions

func ClampTURNTTLSeconds added in v1.13.6

func ClampTURNTTLSeconds(ttlSeconds int) (int, bool)

ClampTURNTTLSeconds bounds a TURN credential TTL to [DefaultTURNTTLSeconds, TURNMaxTTLSeconds]: non-positive values (which would otherwise produce already-expired credentials) fall back to the 5m default and overflowing values clamp to the max. The second return value reports whether the input was out of range.

func GenerateCLIFlags added in v1.3.0

func GenerateCLIFlags(existingFlags []cli.Flag, hidden bool) ([]cli.Flag, error)

func InitLoggerFromConfig added in v1.4.2

func InitLoggerFromConfig(config *LoggingConfig)

func SetLogger added in v1.4.2

func SetLogger(l logger.Logger)

Note: only pass in logr.Logger with default depth

Types

type APIConfig added in v1.3.2

type APIConfig struct {
	// amount of time to wait for API to execute, default 2s
	ExecutionTimeout time.Duration `yaml:"execution_timeout,omitempty"`

	// min amount of time to wait before checking for operation complete
	CheckInterval time.Duration `yaml:"check_interval,omitempty"`

	// max amount of time to wait before checking for operation complete
	MaxCheckInterval time.Duration `yaml:"max_check_interval,omitempty"`

	// Backwards compatibility for room service api calls, will enable by default and remove in a future release
	EnablePsrpcForGetListParticpants bool `yaml:"enable_psrpc_for_get_list_participants,omitempty"`
}

func DefaultAPIConfig added in v1.3.2

func DefaultAPIConfig() APIConfig

type CodecSpec added in v0.10.1

type CodecSpec struct {
	Mime     string `yaml:"mime,omitempty"`
	FmtpLine string `yaml:"fmtp_line,omitempty"`
}

type Config

type Config struct {
	Port          uint32   `yaml:"port,omitempty"`
	BindAddresses []string `yaml:"bind_addresses,omitempty"`
	// PrometheusPort is deprecated
	PrometheusPort uint32                   `yaml:"prometheus_port,omitempty"`
	Prometheus     PrometheusConfig         `yaml:"prometheus,omitempty"`
	DebugHandler   DebugHandlerConfig       `yaml:"debug_handler,omitempty"`
	RTC            RTCConfig                `yaml:"rtc,omitempty"`
	Redis          redisLiveKit.RedisConfig `yaml:"redis,omitempty"`
	Audio          sfu.AudioConfig          `yaml:"audio,omitempty"`
	Video          VideoConfig              `yaml:"video,omitempty"`
	Room           RoomConfig               `yaml:"room,omitempty"`
	TURN           TURNConfig               `yaml:"turn,omitempty"`
	Ingress        IngressConfig            `yaml:"ingress,omitempty"`
	SIP            SIPConfig                `yaml:"sip,omitempty"`
	WebHook        webhook.WebHookConfig    `yaml:"webhook,omitempty"`
	NodeSelector   NodeSelectorConfig       `yaml:"node_selector,omitempty"`
	KeyFile        string                   `yaml:"key_file,omitempty"`
	Keys           map[string]string        `yaml:"keys,omitempty"`
	Region         string                   `yaml:"region,omitempty"`
	SignalRelay    SignalRelayConfig        `yaml:"signal_relay,omitempty"`
	PSRPC          rpc.PSRPCConfig          `yaml:"psrpc,omitempty"`
	// Deprecated: LogLevel is deprecated
	LogLevel string        `yaml:"log_level,omitempty"`
	Logging  LoggingConfig `yaml:"logging,omitempty"`
	Limit    LimitConfig   `yaml:"limit,omitempty"`
	Agents   agent.Config  `yaml:"agents,omitempty"`

	Development bool `yaml:"development,omitempty"`

	Metric metric.MetricConfig `yaml:"metric,omitempty"`
	Trace  TracingConfig       `yaml:"trace,omitempty"`

	NodeStats NodeStatsConfig `yaml:"node_stats,omitempty"`

	EnableDataTracks bool `yaml:"enable_data_tracks,omitempty"`

	EnableParticipantDataBlob bool `yaml:"enable_participant_data_blob,omitempty"`

	API APIConfig `yaml:"api,omitempty"`
}

func NewConfig

func NewConfig(confString string, strictMode bool, c *cli.Command, baseFlags []cli.Flag) (*Config, error)

func (*Config) IsTURNSEnabled added in v1.2.1

func (conf *Config) IsTURNSEnabled() bool

func (*Config) LoadTURNSecrets added in v1.13.0

func (conf *Config) LoadTURNSecrets() error

func (*Config) NormalizeTURNTTLs added in v1.13.6

func (conf *Config) NormalizeTURNTTLs()

NormalizeTURNTTLs clamps configured TURN TTLs to the safe range, warning on any adjustment. Safe to call more than once.

func (*Config) ToCLIFlagNames added in v1.3.0

func (conf *Config) ToCLIFlagNames(existingFlags []cli.Flag) map[string]reflect.Value

func (*Config) ValidateKeys added in v1.3.2

func (conf *Config) ValidateKeys() error

type CongestionControlConfig added in v0.15.2

type CongestionControlConfig struct {
	Enabled    bool `yaml:"enabled,omitempty"`
	AllowPause bool `yaml:"allow_pause,omitempty"`

	StreamAllocator streamallocator.StreamAllocatorConfig `yaml:"stream_allocator,omitempty"`

	RemoteBWE remotebwe.RemoteBWEConfig `yaml:"remote_bwe,omitempty"`

	UseSendSideBWEInterceptor bool `yaml:"use_send_side_bwe_interceptor,omitempty"`

	UseSendSideBWE   bool                          `yaml:"use_send_side_bwe,omitempty"`
	SendSideBWEPacer string                        `yaml:"send_side_bwe_pacer,omitempty"`
	SendSideBWE      sendsidebwe.SendSideBWEConfig `yaml:"send_side_bwe,omitempty"`
}

type DebugHandlerConfig added in v1.13.2

type DebugHandlerConfig struct {
	Port uint32 `yaml:"port,omitempty"`
}

type ForwardStatsConfig added in v1.6.2

type ForwardStatsConfig struct {
	SummaryInterval time.Duration `yaml:"summary_interval,omitempty"`
	ReportInterval  time.Duration `yaml:"report_interval,omitempty"`
	ReportWindow    time.Duration `yaml:"report_window,omitempty"`
}

type IngressConfig added in v1.2.0

type IngressConfig struct {
	RTMPBaseURL string `yaml:"rtmp_base_url,omitempty"`
	WHIPBaseURL string `yaml:"whip_base_url,omitempty"`
}

type LimitConfig added in v0.15.0

type LimitConfig struct {
	NumTracks              int32   `yaml:"num_tracks,omitempty"`
	BytesPerSec            float32 `yaml:"bytes_per_sec,omitempty"`
	SubscriptionLimitVideo int32   `yaml:"subscription_limit_video,omitempty"`
	SubscriptionLimitAudio int32   `yaml:"subscription_limit_audio,omitempty"`
	MaxMetadataSize        uint32  `yaml:"max_metadata_size,omitempty"`
	// total size of all attributes on a participant
	MaxAttributesSize            uint32 `yaml:"max_attributes_size,omitempty"`
	MaxRoomNameLength            int    `yaml:"max_room_name_length,omitempty"`
	MaxParticipantIdentityLength int    `yaml:"max_participant_identity_length,omitempty"`
	MaxParticipantNameLength     int    `yaml:"max_participant_name_length,omitempty"`

	MaxDataBlobKeyLength int    `yaml:"max_data_blob_key_length,omitempty"`
	MaxDataBlobSize      uint32 `yaml:"max_data_blobs_size,omitempty"`

	MaxDataTrackCustomEncodingLength int `yaml:"max_data_track_custom_encoding_length,omitempty"`

	// maximum size (in bytes) of a single message read off a client-facing
	// signalling WebSocket connection. Frames larger than this are rejected by the
	// transport before being buffered, guarding against single-frame memory
	// exhaustion. A value of 0 disables the limit (unbounded).
	SignalMessageSizeLimit int64 `yaml:"signal_message_size_limit,omitempty"`
	// same as SignalMessageSizeLimit, but for agent worker WebSocket connections.
	AgentSignalMessageSizeLimit int64 `yaml:"agent_signal_message_size_limit,omitempty"`

	// maximum size (in bytes) of an HTTP request body accepted on the main API
	// listener (Twirp room/egress/ingress/SIP routes, etc). Requests larger than
	// this are rejected before their body is decoded, so large messages cannot
	// exhaust memory. A value of 0 disables the limit (unbounded).
	MaxAPIRequestBodySize int64 `yaml:"max_api_request_body_size,omitempty"`
}

func (LimitConfig) CanAddDataBlob added in v1.13.2

func (l LimitConfig) CanAddDataBlob(dataBlobs []*livekit.DataBlob, toAdd *livekit.DataBlob) bool

func (LimitConfig) CheckAttributesSize added in v1.7.1

func (l LimitConfig) CheckAttributesSize(attributes map[string]string) bool

func (LimitConfig) CheckDataBlobKeyLength added in v1.13.2

func (l LimitConfig) CheckDataBlobKeyLength(key string) bool

func (LimitConfig) CheckDataBlobsSize added in v1.13.2

func (l LimitConfig) CheckDataBlobsSize(dataBlobs []*livekit.DataBlob) bool

func (LimitConfig) CheckDataTrackCustomEncodingLength added in v1.13.3

func (l LimitConfig) CheckDataTrackCustomEncodingLength(identifier string) bool

func (LimitConfig) CheckDataTrackFrameEncoding added in v1.13.3

func (l LimitConfig) CheckDataTrackFrameEncoding(encoding *livekit.DataTrackFrameEncoding) bool

func (LimitConfig) CheckDataTrackSchemaID added in v1.13.3

func (l LimitConfig) CheckDataTrackSchemaID(schema *livekit.DataTrackSchemaId) bool

func (LimitConfig) CheckMetadataSize added in v1.7.1

func (l LimitConfig) CheckMetadataSize(metadata string) bool

func (LimitConfig) CheckParticipantIdentityLength added in v1.9.1

func (l LimitConfig) CheckParticipantIdentityLength(identity string) bool

func (LimitConfig) CheckParticipantNameLength added in v1.7.1

func (l LimitConfig) CheckParticipantNameLength(name string) bool

func (LimitConfig) CheckRoomNameLength added in v1.7.1

func (l LimitConfig) CheckRoomNameLength(name string) bool

type LoggingConfig added in v0.15.3

type LoggingConfig struct {
	logger.Config `yaml:",inline"`
	PionLevel     string `yaml:"pion_level,omitempty"`
}

type NodeSelectorConfig added in v0.12.3

type NodeSelectorConfig struct {
	Kind         string         `yaml:"kind,omitempty"`
	SortBy       string         `yaml:"sort_by,omitempty"`
	Algorithm    string         `yaml:"algorithm,omitempty"`
	CPULoadLimit float32        `yaml:"cpu_load_limit,omitempty"`
	SysloadLimit float32        `yaml:"sysload_limit,omitempty"`
	Regions      []RegionConfig `yaml:"regions,omitempty"`
}

type NodeStatsConfig added in v1.9.0

type NodeStatsConfig struct {
	StatsUpdateInterval           time.Duration   `yaml:"stats_update_interval,omitempty"`
	StatsRateMeasurementIntervals []time.Duration `yaml:"stats_rate_measurement_intervals,omitempty"`
	StatsMaxDelay                 time.Duration   `yaml:"stats_max_delay,omitempty"`
}

type PlayoutDelayConfig added in v1.4.5

type PlayoutDelayConfig struct {
	Enabled bool `yaml:"enabled,omitempty"`
	Min     int  `yaml:"min,omitempty"`
	Max     int  `yaml:"max,omitempty"`
}

type PrometheusConfig added in v1.7.1

type PrometheusConfig struct {
	Port     uint32 `yaml:"port,omitempty"`
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

type RTCConfig

type RTCConfig struct {
	rtcconfig.RTCConfig `yaml:",inline"`

	TURNServers []TURNServer `yaml:"turn_servers,omitempty"`

	// EnableWarp turns on WARP = SPED (DTLS-in-STUN, saves DTLS round-trip) +
	// SNAP (SCTP INIT in SDP, saves SCTP/data-channel init round-trip).
	// Off by default; experimental.
	EnableWarp bool `yaml:"enable_warp,omitempty"`

	// Deprecated
	StrictACKs bool `yaml:"strict_acks,omitempty"`

	// Deprecated: use PacketBufferSizeVideo and PacketBufferSizeAudio
	PacketBufferSize int `yaml:"packet_buffer_size,omitempty"`
	// Number of packets to buffer for NACK - video
	PacketBufferSizeVideo int `yaml:"packet_buffer_size_video,omitempty"`
	// Number of packets to buffer for NACK - audio
	PacketBufferSizeAudio int `yaml:"packet_buffer_size_audio,omitempty"`

	// Throttle periods for pli/fir rtcp packets
	PLIThrottle sfu.PLIThrottleConfig `yaml:"pli_throttle,omitempty"`

	CongestionControl CongestionControlConfig `yaml:"congestion_control,omitempty"`

	// allow TCP and TURN/TLS fallback
	AllowTCPFallback *bool `yaml:"allow_tcp_fallback,omitempty"`

	// Signaling RTT threshold (in milliseconds) governing ICE/TCP fallback. On a UDP
	// failure, ICE/TCP is attempted only while the measured signaling RTT is below this
	// value; at or above it, supporting clients fall back directly to TURN/TLS. When 0
	// (the default), the RTT check is disabled and ICE/TCP is always attempted (for
	// clients that support it). A positive value also gates allow_udp_unstable_fallback.
	TCPFallbackRTTThreshold int `yaml:"tcp_fallback_rtt_threshold,omitempty"`

	// When enabled, an established UDP connection reporting sustained high packet loss is
	// migrated to ICE/TCP or TURN/TLS. Requires tcp_fallback_rtt_threshold to be set
	// (> 0). Disabled by default.
	AllowUDPUnstableFallback bool `yaml:"allow_udp_unstable_fallback,omitempty"`

	// force a reconnect on a publication error
	ReconnectOnPublicationError *bool `yaml:"reconnect_on_publication_error,omitempty"`

	// force a reconnect on a subscription error
	ReconnectOnSubscriptionError *bool `yaml:"reconnect_on_subscription_error,omitempty"`

	// force a reconnect on a data channel error
	ReconnectOnDataChannelError *bool `yaml:"reconnect_on_data_channel_error,omitempty"`

	// Deprecated
	DataChannelMaxBufferedAmount uint64 `yaml:"data_channel_max_buffered_amount,omitempty"`

	// Threshold of data channel writing to be considered too slow, data packet could
	// be dropped for a slow data channel to avoid blocking the room.
	DatachannelSlowThreshold int `yaml:"datachannel_slow_threshold,omitempty"`

	// Target latency for lossy data channels, used to drop packets to reduce latency.
	DatachannelLossyTargetLatency time.Duration `yaml:"datachannel_lossy_target_latency,omitempty"`

	// Target latency for data track channels, used to drop packets to keep the
	// per-subscriber buffer bounded under downlink congestion. Data tracks are a
	// low-latency lossy transport, so a stale queued frame is worse than a dropped
	// one. Set to 0 to disable buffering control (unbounded buffering).
	DatachannelDataTrackTargetLatency time.Duration `yaml:"datachannel_data_track_target_latency,omitempty"`

	ForwardStats ForwardStatsConfig `yaml:"forward_stats,omitempty"`

	// enable rtp stream restart detection for published tracks
	EnableRTPStreamRestartDetection bool `yaml:"enable_rtp_stream_restart_detection,omitempty"`
}

type RegionConfig added in v0.13.5

type RegionConfig struct {
	Name string  `yaml:"name,omitempty"`
	Lat  float64 `yaml:"lat,omitempty"`
	Lon  float64 `yaml:"lon,omitempty"`
}

RegionConfig lists available regions and their latitude/longitude, so the selector would prefer regions that are closer

type RoomConfig added in v0.10.1

type RoomConfig struct {
	// enable rooms to be automatically created
	AutoCreate         bool               `yaml:"auto_create,omitempty"`
	EnabledCodecs      []CodecSpec        `yaml:"enabled_codecs,omitempty"`
	MaxParticipants    uint32             `yaml:"max_participants,omitempty"`
	EmptyTimeout       uint32             `yaml:"empty_timeout,omitempty"`
	DepartureTimeout   uint32             `yaml:"departure_timeout,omitempty"`
	EnableRemoteUnmute bool               `yaml:"enable_remote_unmute,omitempty"`
	PlayoutDelay       PlayoutDelayConfig `yaml:"playout_delay,omitempty"`
	SyncStreams        bool               `yaml:"sync_streams,omitempty"`
	CreateRoomTimeout  time.Duration      `yaml:"create_room_timeout,omitempty"`
	CreateRoomAttempts int                `yaml:"create_room_attempts,omitempty"`
	// include room metadata in track webhook events instead of just room SID and name
	EnableFullRoomInWebhooks bool `yaml:"enable_full_room_in_webhooks,omitempty"`
	// target room participant update batch chunk size in bytes
	UpdateBatchTargetSize int `yaml:"update_batch_target_size,omitempty"`
	// deprecated, moved to limits
	MaxMetadataSize uint32 `yaml:"max_metadata_size,omitempty"`
	// deprecated, moved to limits
	MaxRoomNameLength int `yaml:"max_room_name_length,omitempty"`
	// deprecated, moved to limits
	MaxParticipantIdentityLength int                                   `yaml:"max_participant_identity_length,omitempty"`
	RoomConfigurations           map[string]*livekit.RoomConfiguration `yaml:"room_configurations,omitempty"`
}

type SIPConfig added in v1.5.2

type SIPConfig struct{}

type SignalRelayConfig added in v1.4.0

type SignalRelayConfig struct {
	RetryTimeout     time.Duration `yaml:"retry_timeout,omitempty"`
	MinRetryInterval time.Duration `yaml:"min_retry_interval,omitempty"`
	MaxRetryInterval time.Duration `yaml:"max_retry_interval,omitempty"`
	StreamBufferSize int           `yaml:"stream_buffer_size,omitempty"`
	ConnectAttempts  int           `yaml:"connect_attempts,omitempty"`
}

type TURNConfig

type TURNConfig struct {
	Enabled             bool     `yaml:"enabled,omitempty"`
	Domain              string   `yaml:"domain,omitempty"`
	CertFile            string   `yaml:"cert_file,omitempty"`
	KeyFile             string   `yaml:"key_file,omitempty"`
	TLSPort             int      `yaml:"tls_port,omitempty"`
	UDPPort             int      `yaml:"udp_port,omitempty"`
	RelayPortRangeStart uint16   `yaml:"relay_range_start,omitempty"`
	RelayPortRangeEnd   uint16   `yaml:"relay_range_end,omitempty"`
	ExternalTLS         bool     `yaml:"external_tls,omitempty"`
	BindAddresses       []string `yaml:"bind_addresses,omitempty"`
	// PerUserRelayAllocationLimit caps the number of concurrent relay allocations
	// a single participant credential may hold, keyed by the participant ID. This
	// stops one authenticated participant from consuming the shared relay-port
	// range and denying TURN relays to others. Defaults to
	// DefaultTURNPerUserRelayAllocationLimit; a value <= 0 disables the quota.
	PerUserRelayAllocationLimit int `yaml:"per_user_relay_allocation_limit,omitempty"`
	// TTL of the TURN credentials in seconds - defaults to 300. Values <= 0 fall back to the
	// 300s (5m) default and large values are capped at TURNMaxTTLSeconds.
	TTLSeconds int `yaml:"ttl_seconds,omitempty"`
	// list of restricted peer CIDRs (loopback, link-local (unicast, multicast), multicast, private, unspecified) to allow access to.
	// By default (i. e. empty list), all restricted peer CIDRs are denied access.
	// When not empty, only the specified CIDRs are allowed access.
	// Note that this check is applied to restricted peer CIDRs only.
	AllowRestrictedPeerCIDRs []string `yaml:"allow_restricted_peer_cidrs,omitempty"`
	// list of peer CIDRs to deny access to
	// This applies to all peer CIDRs, including restricted ones.
	// Deny list takes precedence over allow list.
	DenyPeerCIDRs []string `yaml:"deny_peer_cidrs,omitempty"`
}

type TURNServer added in v0.15.4

type TURNServer struct {
	Host       string `yaml:"host,omitempty"`
	Port       int    `yaml:"port,omitempty"`
	Protocol   string `yaml:"protocol,omitempty"`
	Username   string `yaml:"username,omitempty"`
	Credential string `yaml:"credential,omitempty"`
	// Secret is used for TURN static auth secrets mechanism. When provided,
	// dynamic credentials are generated using HMAC-SHA1 instead of static Username/Credential
	Secret string `yaml:"secret,omitempty"`
	// File containing the secret
	SecretFile string `yaml:"secret_file,omitempty"`
	// TTL is the time-to-live in seconds for generated credentials when using Secret.
	// Defaults to 14400 seconds (4 hours) when 0. Negative values fall back to the 5m
	// default and large values are capped at TURNMaxTTLSeconds.
	TTL int `yaml:"ttl,omitempty"`
}

type TracingConfig added in v1.9.11

type TracingConfig struct {
	// JaegerURL configures Jaeger as a global tracer.
	//
	// The following formats are supported: <hostname>, <host>:<port>, http(s)://<host>/<path>
	JaegerURL string `yaml:"jaeger_url,omitempty"`
}

type VideoConfig added in v0.15.6

type VideoConfig struct {
	DynacastPauseDelay   time.Duration                  `yaml:"dynacast_pause_delay,omitempty"`
	StreamTrackerManager sfu.StreamTrackerManagerConfig `yaml:"stream_tracker_manager,omitempty"`

	CodecRegressionThreshold int `yaml:"codec_regression_threshold,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL