Documentation ¶
Index ¶
- Constants
- Variables
- func InitConfig(c *Config)
- func NewInterceptorRegistry(mediaEngine *webrtc.MediaEngine) (*interceptor.Registry, error)
- func NewMediaEngine() *webrtc.MediaEngine
- func NewMeshHandler(log logger.Logger, wss *WSS) http.Handler
- func NewNetworkTypes(log logger.Logger, networkTypes []string) (ret []webrtc.NetworkType)
- func ParseUDPAddr(addr string) (*net.UDPAddr, error)
- func ParseUDPAddrs(addrs []string) ([]*net.UDPAddr, error)
- func ReadConfigFile(filename string, c *Config) (err error)
- func ReadConfigFiles(filenames []string, c *Config) (err error)
- func ReadConfigFromEnv(prefix string, c *Config)
- func ReadConfigYAML(reader io.Reader, c *Config) error
- func RegisterCodecs(mediaEngine *webrtc.MediaEngine, registry *codecs.Registry)
- type Adapter
- type AdapterFactory
- type AdapterRoomManager
- type AuthType
- type ByteSerializer
- type ChannelRoomManager
- func (r *ChannelRoomManager) AcceptEvent() (RoomEvent, error)
- func (r *ChannelRoomManager) Close()
- func (r *ChannelRoomManager) Enter(room identifiers.RoomID) (adapter Adapter, isNew bool)
- func (r *ChannelRoomManager) Exit(room identifiers.RoomID) (isRemoved bool)
- func (r *ChannelRoomManager) RoomEventsChannel() <-chan RoomEvent
- type Client
- func (c *Client) Close(statusCode websocket.StatusCode, reason string) error
- func (c *Client) Err() error
- func (c *Client) ID() identifiers.ClientID
- func (c *Client) Messages() <-chan message.Message
- func (c *Client) Metadata() string
- func (c *Client) SetMetadata(metadata string)
- func (c *Client) Write(msg message.Message) error
- func (c *Client) WriteCtx(ctx context.Context, msg message.Message) error
- type ClientConfig
- type ClientWriter
- type Config
- type DataTransceiver
- type Deserializer
- type Doner
- type Embed
- type Frontend
- type ICEAuthServer
- type ICEServer
- type JSONMessage
- type LocalTrack
- type MemoryAdapter
- func (m *MemoryAdapter) Add(client ClientWriter) (err error)
- func (m *MemoryAdapter) Broadcast(msg message.Message) error
- func (m *MemoryAdapter) Clients() (clientIDs map[identifiers.ClientID]string, err error)
- func (m *MemoryAdapter) Close() error
- func (m *MemoryAdapter) Emit(clientID identifiers.ClientID, msg message.Message) error
- func (m *MemoryAdapter) Metadata(clientID identifiers.ClientID) (metadata string, ok bool)
- func (m *MemoryAdapter) Remove(clientID identifiers.ClientID) (err error)
- func (m *MemoryAdapter) SetMetadata(clientID identifiers.ClientID, metadata string) (ok bool)
- func (m *MemoryAdapter) Size() (value int, err error)
- type MultiErrorHandler
- type Mux
- type Negotiator
- type NetworkConfig
- type NetworkConfigSFU
- type NetworkType
- type NewAdapterFunc
- type NodeManager
- type NodeManagerParams
- type PageHandler
- type Params
- type PeerConfig
- type Pinger
- type PrometheusConfig
- type ReadyMessage
- type RedisAdapter
- func (a *RedisAdapter) Add(client ClientWriter) (err error)
- func (a *RedisAdapter) Broadcast(msg message.Message) error
- func (a *RedisAdapter) Clients() (map[identifiers.ClientID]string, error)
- func (a *RedisAdapter) Close() error
- func (a *RedisAdapter) Emit(clientID identifiers.ClientID, msg message.Message) error
- func (a *RedisAdapter) Metadata(clientID identifiers.ClientID) (metadata string, ok bool)
- func (a *RedisAdapter) Remove(clientID identifiers.ClientID) error
- func (a *RedisAdapter) SetMetadata(clientID identifiers.ClientID, metadata string) (ok bool)
- func (a *RedisAdapter) Size() (size int, err error)
- type RedisConfig
- type RemoteTrack
- type Renderer
- type RoomEvent
- type RoomEventType
- type RoomManager
- type RoomManagerFactory
- type RoomManagerFactoryParams
- type SFU
- type Serializer
- type Server
- type Signaller
- func (s *Signaller) Close() (err error)
- func (s *Signaller) Done() <-chan struct{}
- func (s *Signaller) Initiator() bool
- func (s *Signaller) Negotiate() <-chan struct{}
- func (s *Signaller) NegotiationDone() <-chan struct{}
- func (s *Signaller) SendTransceiverRequest(kind webrtc.RTPCodecType, direction webrtc.RTPTransceiverDirection)
- func (s *Signaller) Signal(signal message.Signal) error
- func (s *Signaller) SignalChannel() <-chan message.Signal
- type SocketHandler
- type StoreConfig
- type StoreType
- type TLSConfig
- type Templates
- type TracksManager
- type TransceiverRequest
- type TransportConfig
- type WSCloser
- type WSReadWriter
- type WSReader
- type WSS
- type WSWriter
- type WebRTCTransport
- func (p *WebRTCTransport) AddTrack(t transport.Track) (transport.TrackLocal, transport.RTCPReader, error)
- func (p *WebRTCTransport) ClientID() identifiers.ClientID
- func (p *WebRTCTransport) Close() error
- func (p *WebRTCTransport) Done() <-chan struct{}
- func (p *WebRTCTransport) LocalTracks() []transport.TrackWithMID
- func (p *WebRTCTransport) MessagesChannel() <-chan webrtc.DataChannelMessage
- func (p *WebRTCTransport) RemoteTracksChannel() <-chan transport.TrackRemoteWithRTCPReader
- func (p *WebRTCTransport) RemoveTrack(trackID identifiers.TrackID) error
- func (p *WebRTCTransport) Send(message webrtc.DataChannelMessage) <-chan error
- func (p *WebRTCTransport) Signal(signal message.Signal) error
- func (p *WebRTCTransport) SignalChannel() <-chan message.Signal
- func (p *WebRTCTransport) Type() transport.Type
- func (p *WebRTCTransport) WriteRTCP(packets []rtcp.Packet) error
- type WebRTCTransportFactory
- type WebsocketContext
- func (w *WebsocketContext) Adapter() Adapter
- func (w *WebsocketContext) ClientID() identifiers.ClientID
- func (w *WebsocketContext) Close(statusCode websocket.StatusCode, reason string) error
- func (w *WebsocketContext) Messages() <-chan message.Message
- func (w *WebsocketContext) RoomID() identifiers.RoomID
Constants ¶
const IOSH264Fmtp = "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f"
Variables ¶
var ErrDuplicateClientID = errors.New("duplicate client id")
Functions ¶
func InitConfig ¶
func InitConfig(c *Config)
func NewInterceptorRegistry ¶
func NewInterceptorRegistry(mediaEngine *webrtc.MediaEngine) (*interceptor.Registry, error)
func NewMediaEngine ¶
func NewMediaEngine() *webrtc.MediaEngine
func NewNetworkTypes ¶
func NewNetworkTypes(log logger.Logger, networkTypes []string) (ret []webrtc.NetworkType)
func ReadConfigFile ¶
func ReadConfigFiles ¶
func ReadConfigFromEnv ¶
func RegisterCodecs ¶
func RegisterCodecs(mediaEngine *webrtc.MediaEngine, registry *codecs.Registry)
Types ¶
type Adapter ¶
type Adapter interface { Add(client ClientWriter) error Remove(clientID identifiers.ClientID) error Broadcast(msg message.Message) error Metadata(clientID identifiers.ClientID) (string, bool) SetMetadata(clientID identifiers.ClientID, metadata string) bool Emit(clientID identifiers.ClientID, msg message.Message) error Clients() (map[identifiers.ClientID]string, error) Size() (int, error) Close() error }
type AdapterFactory ¶
type AdapterFactory struct { NewAdapter func(room identifiers.RoomID) Adapter // contains filtered or unexported fields }
func NewAdapterFactory ¶
func NewAdapterFactory(log logger.Logger, c StoreConfig) *AdapterFactory
func (*AdapterFactory) Close ¶
func (a *AdapterFactory) Close() (err error)
type AdapterRoomManager ¶
type AdapterRoomManager struct {
// contains filtered or unexported fields
}
func NewAdapterRoomManager ¶
func NewAdapterRoomManager(newAdapter NewAdapterFunc) *AdapterRoomManager
func (*AdapterRoomManager) Enter ¶
func (r *AdapterRoomManager) Enter(room identifiers.RoomID) (adapter Adapter, isNew bool)
func (*AdapterRoomManager) Exit ¶
func (r *AdapterRoomManager) Exit(room identifiers.RoomID) (isRemoved bool)
type ByteSerializer ¶
type ByteSerializer struct{}
func (ByteSerializer) Deserialize ¶
func (s ByteSerializer) Deserialize(data []byte) (msg message.Message, err error)
type ChannelRoomManager ¶
type ChannelRoomManager struct {
// contains filtered or unexported fields
}
func NewChannelRoomManager ¶
func NewChannelRoomManager(roomManager RoomManager) *ChannelRoomManager
func (*ChannelRoomManager) AcceptEvent ¶
func (r *ChannelRoomManager) AcceptEvent() (RoomEvent, error)
func (*ChannelRoomManager) Close ¶
func (r *ChannelRoomManager) Close()
Close exists for tests. This channel should always stay open IRL.
func (*ChannelRoomManager) Enter ¶
func (r *ChannelRoomManager) Enter(room identifiers.RoomID) (adapter Adapter, isNew bool)
func (*ChannelRoomManager) Exit ¶
func (r *ChannelRoomManager) Exit(room identifiers.RoomID) (isRemoved bool)
func (*ChannelRoomManager) RoomEventsChannel ¶
func (r *ChannelRoomManager) RoomEventsChannel() <-chan RoomEvent
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
An abstraction for sending out to websocket using channels.
func NewClientWithID ¶
func NewClientWithID(conn WSReadWriter, id identifiers.ClientID) *Client
func (*Client) Close ¶
func (c *Client) Close(statusCode websocket.StatusCode, reason string) error
Close invokes Close on the underlying websocket connection.
func (*Client) Err ¶
Err returns the read error that might have occurred. It should be called after the Messages channel is closed.
func (*Client) ID ¶
func (c *Client) ID() identifiers.ClientID
func (*Client) SetMetadata ¶
type ClientConfig ¶
type ClientConfig struct { BaseURL string `json:"baseUrl"` Nickname string `json:"nickname"` CallID string `json:"callId"` PeerID string `json:"peerId"` PeerConfig PeerConfig `json:"peerConfig"` Network NetworkType `json:"network"` }
type ClientWriter ¶
type Config ¶
type Config struct { BaseURL string `yaml:"base_url"` BindHost string `yaml:"bind_host"` BindPort int `yaml:"bind_port"` // When FS is non empty, it will be used as a root path to the resource files. FS string `yaml:"fs"` ICEServers []ICEServer `yaml:"ice_servers"` TLS TLSConfig `yaml:"tls"` Store StoreConfig `yaml:"store"` Network NetworkConfig `yaml:"network"` Prometheus PrometheusConfig `yaml:"prometheus"` Frontend Frontend `yaml:"frontend"` }
func ReadConfig ¶
type DataTransceiver ¶
type DataTransceiver struct {
// contains filtered or unexported fields
}
func NewDataTransceiver ¶
func NewDataTransceiver( log logger.Logger, clientID identifiers.ClientID, dataChannel *webrtc.DataChannel, peerConnection *webrtc.PeerConnection, ) *DataTransceiver
func (*DataTransceiver) Close ¶
func (d *DataTransceiver) Close()
func (*DataTransceiver) MessagesChannel ¶
func (d *DataTransceiver) MessagesChannel() <-chan webrtc.DataChannelMessage
func (*DataTransceiver) Send ¶
func (d *DataTransceiver) Send(message webrtc.DataChannelMessage) <-chan error
type Frontend ¶
type Frontend struct {
EncodedInsertableStreams bool `yaml:"encodedInsertableStreams"`
}
type ICEAuthServer ¶
type ICEAuthServer struct { URLs []string `json:"urls"` Username string `json:"username,omitempty"` Credential string `json:"credential,omitempty"` }
func GetICEAuthServers ¶
func GetICEAuthServers(servers []ICEServer) (result []ICEAuthServer)
type JSONMessage ¶
type LocalTrack ¶
type LocalTrack struct { *webrtc.TrackLocalStaticRTP // contains filtered or unexported fields }
func (LocalTrack) Track ¶
func (t LocalTrack) Track() transport.Track
type MemoryAdapter ¶
type MemoryAdapter struct {
// contains filtered or unexported fields
}
func NewMemoryAdapter ¶
func NewMemoryAdapter(room identifiers.RoomID) *MemoryAdapter
func (*MemoryAdapter) Add ¶
func (m *MemoryAdapter) Add(client ClientWriter) (err error)
Add a client to the room. Will return an error on duplicate client ID.
func (*MemoryAdapter) Broadcast ¶
func (m *MemoryAdapter) Broadcast(msg message.Message) error
Send a message to all sockets
func (*MemoryAdapter) Clients ¶
func (m *MemoryAdapter) Clients() (clientIDs map[identifiers.ClientID]string, err error)
Returns clients with metadata
func (*MemoryAdapter) Close ¶
func (m *MemoryAdapter) Close() error
func (*MemoryAdapter) Emit ¶
func (m *MemoryAdapter) Emit(clientID identifiers.ClientID, msg message.Message) error
Sends a message to specific socket.
func (*MemoryAdapter) Metadata ¶
func (m *MemoryAdapter) Metadata(clientID identifiers.ClientID) (metadata string, ok bool)
func (*MemoryAdapter) Remove ¶
func (m *MemoryAdapter) Remove(clientID identifiers.ClientID) (err error)
Remove a client from the room
func (*MemoryAdapter) SetMetadata ¶
func (m *MemoryAdapter) SetMetadata(clientID identifiers.ClientID, metadata string) (ok bool)
func (*MemoryAdapter) Size ¶
func (m *MemoryAdapter) Size() (value int, err error)
type MultiErrorHandler ¶
type Mux ¶
type Mux struct { BaseURL string // contains filtered or unexported fields }
func NewMux ¶
func NewMux( log logger.Logger, baseURL string, version string, network NetworkConfig, iceServers []ICEServer, encodedInsertableStreams bool, rooms RoomManager, tracks TracksManager, prom PrometheusConfig, embed Embed, ) *Mux
type Negotiator ¶
type Negotiator struct {
// contains filtered or unexported fields
}
func NewNegotiator ¶
func NewNegotiator( log logger.Logger, initiator bool, peerConnection *webrtc.PeerConnection, onOffer func(webrtc.SessionDescription, error), onRequestNegotiation func(), ) *Negotiator
func (*Negotiator) AddTransceiverFromKind ¶
func (n *Negotiator) AddTransceiverFromKind(t TransceiverRequest)
func (*Negotiator) Done ¶
func (n *Negotiator) Done() <-chan struct{}
func (*Negotiator) Negotiate ¶
func (n *Negotiator) Negotiate() (done <-chan struct{})
type NetworkConfig ¶
type NetworkConfig struct { Type NetworkType `yaml:"type"` SFU NetworkConfigSFU `yaml:"sfu"` }
type NetworkConfigSFU ¶
type NetworkConfigSFU struct { Interfaces []string `yaml:"interfaces"` // JitterBuffer is disabled for now. JitterBuffer bool `yaml:"jitter_buffer"` Protocols []string `yaml:"protocols"` TCPBindAddr string `yaml:"tcp_bind_addr"` TCPListenPort int `yaml:"tcp_listen_port"` Transport TransportConfig `yaml:"transport"` UDP struct { PortMin uint16 `yaml:"port_min"` PortMax uint16 `yaml:"port_max"` } `yaml:"udp"` }
type NetworkType ¶
type NetworkType string
const ( NetworkTypeMesh NetworkType = "mesh" NetworkTypeSFU NetworkType = "sfu" )
type NewAdapterFunc ¶
type NewAdapterFunc func(room identifiers.RoomID) Adapter
type NodeManager ¶
type NodeManager struct {
// contains filtered or unexported fields
}
func NewNodeManager ¶
func NewNodeManager(params NodeManagerParams) (*NodeManager, error)
func (*NodeManager) Close ¶
func (nm *NodeManager) Close() error
type NodeManagerParams ¶
type NodeManagerParams struct { Log logger.Logger RoomManager *ChannelRoomManager TracksManager TracksManager ListenAddr *net.UDPAddr Nodes []*net.UDPAddr }
type PageHandler ¶
type PeerConfig ¶
type PeerConfig struct { ICEServers []ICEAuthServer `json:"iceServers"` EncodedInsertableStreams bool `json:"encodedInsertableStreams"` }
type Pinger ¶
type Pinger struct {
// contains filtered or unexported fields
}
Pinger is a component that sends pings to clients on a regular interval and receives pongs back.
func NewPinger ¶
NewPinger creates a new instance of Pinger and starts a ticker whose duration is set to dur. The ping callback is called on every interval. The main event loop will be closed when ctx is done.
func (*Pinger) ReceivePong ¶
func (p *Pinger) ReceivePong()
ReceivePong notifies the main event loop of a new pong response in a non-blocking manner.
type PrometheusConfig ¶
type PrometheusConfig struct {
AccessToken string `yaml:"access_token"`
}
type ReadyMessage ¶
type RedisAdapter ¶
type RedisAdapter struct {
// contains filtered or unexported fields
}
func NewRedisAdapter ¶
func NewRedisAdapter( log logger.Logger, pubRedis *redis.Client, subRedis *redis.Client, prefix string, room identifiers.RoomID, ) *RedisAdapter
func (*RedisAdapter) Add ¶
func (a *RedisAdapter) Add(client ClientWriter) (err error)
func (*RedisAdapter) Clients ¶
func (a *RedisAdapter) Clients() (map[identifiers.ClientID]string, error)
Returns IDs of all known clients connected to this room
func (*RedisAdapter) Close ¶
func (a *RedisAdapter) Close() error
Close closes the subscription, but not the redis clients
func (*RedisAdapter) Emit ¶
func (a *RedisAdapter) Emit(clientID identifiers.ClientID, msg message.Message) error
func (*RedisAdapter) Metadata ¶
func (a *RedisAdapter) Metadata(clientID identifiers.ClientID) (metadata string, ok bool)
func (*RedisAdapter) Remove ¶
func (a *RedisAdapter) Remove(clientID identifiers.ClientID) error
func (*RedisAdapter) SetMetadata ¶
func (a *RedisAdapter) SetMetadata(clientID identifiers.ClientID, metadata string) (ok bool)
func (*RedisAdapter) Size ¶
func (a *RedisAdapter) Size() (size int, err error)
Returns count of all known clients connected to this room
type RedisConfig ¶
type RemoteTrack ¶
type RemoteTrack struct { *webrtc.TrackRemote // contains filtered or unexported fields }
func (RemoteTrack) Track ¶
func (t RemoteTrack) Track() transport.Track
type Renderer ¶
func NewRenderer ¶
func (*Renderer) Render ¶
func (tr *Renderer) Render(h PageHandler) http.HandlerFunc
type RoomEvent ¶
type RoomEvent struct { RoomName identifiers.RoomID Type RoomEventType }
type RoomEventType ¶
type RoomEventType int
const ( RoomEventTypeAdd RoomEventType = iota + 1 RoomEventTypeRemove )
type RoomManager ¶
type RoomManager interface { Enter(room identifiers.RoomID) (adapter Adapter, isNew bool) Exit(room identifiers.RoomID) (isRemoved bool) }
type RoomManagerFactory ¶
type RoomManagerFactory struct {
// contains filtered or unexported fields
}
func NewRoomManagerFactory ¶
func NewRoomManagerFactory(params RoomManagerFactoryParams) *RoomManagerFactory
func (*RoomManagerFactory) NewRoomManager ¶
func (rmf *RoomManagerFactory) NewRoomManager(c NetworkConfig) (RoomManager, *NodeManager)
type RoomManagerFactoryParams ¶
type RoomManagerFactoryParams struct { AdapterFactory *AdapterFactory TracksManager TracksManager Log logger.Logger }
type SFU ¶
type SFU struct {
// contains filtered or unexported fields
}
func NewSFUHandler ¶
func NewSFUHandler( log logger.Logger, wss *WSS, iceServers []ICEServer, sfuConfig NetworkConfigSFU, tracksManager TracksManager, ) *SFU
type Signaller ¶
type Signaller struct {
// contains filtered or unexported fields
}
func NewSignaller ¶
func (*Signaller) Done ¶
func (s *Signaller) Done() <-chan struct{}
This does not close any channel, but returns a channel that can be used for signalling closing of peer connection
func (*Signaller) Negotiate ¶
func (s *Signaller) Negotiate() <-chan struct{}
Create an offer and send it to remote peer
func (*Signaller) NegotiationDone ¶
func (s *Signaller) NegotiationDone() <-chan struct{}
NegotiationDone returns the channel that will be closed as soon as the current negotiation is done. If there is no negotiation in progress, it returns a closed channel. If there is a negotiation in progress, and the negotiation was initiated by a call to Negotiate(), it will return the same channel as Negotiate.
func (*Signaller) SendTransceiverRequest ¶
func (s *Signaller) SendTransceiverRequest(kind webrtc.RTPCodecType, direction webrtc.RTPTransceiverDirection)
Sends a request for a new transceiver, only if the peer is not the initiator.
func (*Signaller) SignalChannel ¶
type SocketHandler ¶
type SocketHandler struct {
// contains filtered or unexported fields
}
func NewSocketHandler ¶
func NewSocketHandler( ctx context.Context, log logger.Logger, tracksManager TracksManager, webRTCTransportFactory *WebRTCTransportFactory, clientID identifiers.ClientID, room identifiers.RoomID, adapter Adapter, ) *SocketHandler
func (*SocketHandler) HandleMessage ¶
func (sh *SocketHandler) HandleMessage(msg message.Message) error
func (*SocketHandler) HangUp ¶
func (sh *SocketHandler) HangUp()
type StoreConfig ¶
type StoreConfig struct { Type StoreType `yaml:"type"` Redis RedisConfig `yaml:"redis"` }
type Templates ¶
func ParseTemplates ¶
type TracksManager ¶
type TransceiverRequest ¶
type TransceiverRequest struct { CodecType webrtc.RTPCodecType Init webrtc.RtpTransceiverInit }
type TransportConfig ¶
type WSCloser ¶
type WSCloser interface {
Close(statusCode websocket.StatusCode, reason string) error
}
type WSReadWriter ¶
type WSS ¶
type WSS struct {
// contains filtered or unexported fields
}
func (*WSS) NewWebsocketContext ¶
func (wss *WSS) NewWebsocketContext(w http.ResponseWriter, r *http.Request) (*WebsocketContext, error)
NewWebsocketContext initializes a new websocket connection. Users must remember to call WebsocketContext.Close after they are done with the connection.
type WebRTCTransport ¶
type WebRTCTransport struct {
// contains filtered or unexported fields
}
func NewWebRTCTransport ¶
func NewWebRTCTransport( log logger.Logger, roomID identifiers.RoomID, clientID identifiers.ClientID, peerID identifiers.PeerID, initiator bool, peerConnection *webrtc.PeerConnection, codecRegistry *codecs.Registry, ) (*WebRTCTransport, error)
func (*WebRTCTransport) AddTrack ¶
func (p *WebRTCTransport) AddTrack(t transport.Track) (transport.TrackLocal, transport.RTCPReader, error)
func (*WebRTCTransport) ClientID ¶
func (p *WebRTCTransport) ClientID() identifiers.ClientID
func (*WebRTCTransport) Close ¶
func (p *WebRTCTransport) Close() error
func (*WebRTCTransport) Done ¶
func (p *WebRTCTransport) Done() <-chan struct{}
func (*WebRTCTransport) LocalTracks ¶
func (p *WebRTCTransport) LocalTracks() []transport.TrackWithMID
LocalTracks returns info about sending tracks
func (*WebRTCTransport) MessagesChannel ¶
func (p *WebRTCTransport) MessagesChannel() <-chan webrtc.DataChannelMessage
func (*WebRTCTransport) RemoteTracksChannel ¶
func (p *WebRTCTransport) RemoteTracksChannel() <-chan transport.TrackRemoteWithRTCPReader
func (*WebRTCTransport) RemoveTrack ¶
func (p *WebRTCTransport) RemoveTrack(trackID identifiers.TrackID) error
func (*WebRTCTransport) Send ¶
func (p *WebRTCTransport) Send(message webrtc.DataChannelMessage) <-chan error
func (*WebRTCTransport) SignalChannel ¶
func (p *WebRTCTransport) SignalChannel() <-chan message.Signal
func (*WebRTCTransport) Type ¶
func (p *WebRTCTransport) Type() transport.Type
type WebRTCTransportFactory ¶
type WebRTCTransportFactory struct {
// contains filtered or unexported fields
}
func NewWebRTCTransportFactory ¶
func NewWebRTCTransportFactory( log logger.Logger, iceServers []ICEServer, sfuConfig NetworkConfigSFU, ) *WebRTCTransportFactory
func (WebRTCTransportFactory) NewWebRTCTransport ¶
func (f WebRTCTransportFactory) NewWebRTCTransport( roomID identifiers.RoomID, clientID identifiers.ClientID, peerID identifiers.PeerID, ) (*WebRTCTransport, error)
type WebsocketContext ¶
type WebsocketContext struct {
// contains filtered or unexported fields
}
func NewWebsocketContext ¶
func NewWebsocketContext( adapter Adapter, client *Client, roomID identifiers.RoomID, onClose func(), ) *WebsocketContext
NewWebsocketContext initializes the new websocket context. Users must call the Close method once they are done.
func (*WebsocketContext) Adapter ¶
func (w *WebsocketContext) Adapter() Adapter
Adapter returns the websocket adapter.
func (*WebsocketContext) ClientID ¶
func (w *WebsocketContext) ClientID() identifiers.ClientID
ClientID return sthe client identifier.
func (*WebsocketContext) Close ¶
func (w *WebsocketContext) Close(statusCode websocket.StatusCode, reason string) error
Close invokes the Close method on the underlying connection. It also invokes the onClose handler.
func (*WebsocketContext) Messages ¶
func (w *WebsocketContext) Messages() <-chan message.Message
Messages returns the parsed messages channel.
func (*WebsocketContext) RoomID ¶
func (w *WebsocketContext) RoomID() identifiers.RoomID
RoomID returns the room identifier.
Source Files ¶
- adapterfactory.go
- addr.go
- configread.go
- configtypes.go
- datatransceiver.go
- embed.go
- errors.go
- iceauth.go
- memoryadapter.go
- mesh.go
- mux.go
- network_types.go
- nodemanager.go
- pinger.go
- pprof.go
- prometheus.go
- redisadapter.go
- render.go
- room.go
- roommanagerfactory.go
- server.go
- sfu.go
- template.go
- webrtc_track_local.go
- webrtctransport.go
- wrtcnegotiator.go
- wrtcsignaller.go
- wsadapter.go
- wsclient.go
- wsmessage.go
- wssub.go
Directories ¶
Path | Synopsis |
---|---|
The SFU package contains the building blocks for building a selective forwarding unit powered by pion/webrtc.
|
The SFU package contains the building blocks for building a selective forwarding unit powered by pion/webrtc. |