server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0, MIT Imports: 42 Imported by: 0

Documentation

Overview

Package server owns the Relay HTTP, WebSocket, WHIP, and WebRTC session boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInterceptorRegistry

func NewInterceptorRegistry(mediaEngine *webrtc.MediaEngine) (*interceptor.Registry, error)

func NewMediaEngineWithAudioNACK

func NewMediaEngineWithAudioNACK() (*webrtc.MediaEngine, error)

Types

type Config

type Config struct {
	AccessService            *access.Service
	AccessHandlerConfig      access.HandlerConfig
	JWTSecret                []byte
	AuthorityMode            string
	SettingEngine            *webrtc.SettingEngine
	API                      *webrtc.API
	MaxRooms                 int
	MaxSubscribersPerRoom    int
	MaxRoomsPerIPPerMinute   int
	MaxConcurrentHandshakes  int
	MaxInvitations           int
	CallbackClient           *callback.Client
	ControlAuthorityTimeout  time.Duration
	ControlReconcileInterval time.Duration
	RelayEpoch               string
	WebhookDispatcher        *webhook.Dispatcher
	ICEServers               []webrtc.ICEServer
	ClientICEServers         []webrtc.ICEServer
	ICETCPMux                pionIce.TCPMux
	ICEUDPMux                pionIce.UDPMux
	RegistryConfig           session.RegistryConfig
	UseTURN                  bool
	NAT1To1IPs               []string
	PublicReceiverURL        string
	PublicRelayURL           string
	PublicControlPlaneURL    string
}

Config holds the parameters for creating a Server.

type Server

type Server struct {
	Metrics *metrics.Registry
	// contains filtered or unexported fields
}

Server is the top-level relay server.

func New

func New(cfg Config) *Server

New creates a Server from cfg.

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) Serve

func (s *Server) Serve(address string) error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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