ftl

package
v0.0.0-...-ad8d7c7 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 21 Imported by: 3

README

FTL Protocol

Reimplementation of the ftl-sdk published by Microsoft.

Not complete.

Documentation

Index

Constants

View Source
const (
	DefaultPort  = 8084
	VersionMajor = 0
	VersionMinor = 2
)
View Source
const (
	MaxLineLenBytes  = 1024
	ReadWriteTimeout = time.Minute

	FTL_PAYLOAD_TYPE_SENDER_REPORT = 200
	FTL_PAYLOAD_TYPE_PING          = 250
)

Variables

View Source
var ErrClosed = errors.New("connection is closed")
View Source
var ErrConnectBeforeAuth = errors.New("control connection attempted command before successful authentication")

Connection Errors

View Source
var ErrInvalidHmacHash = errors.New("client provided invalid HMAC hash")
View Source
var ErrInvalidHmacHex = errors.New("client provided HMAC hash that could not be hex decoded")
View Source
var ErrMultipleConnect = errors.New("control connection attempted multiple CONNECT handshakes")
View Source
var ErrRead = errors.New("error during read")
View Source
var ErrUnexpectedArguments = errors.New("unexpected arguments")
View Source
var ErrWrite = errors.New("error during write")

Functions

This section is empty.

Types

type ChannelID

type ChannelID uint32

Custom Types

type Conn

type Conn struct {
	AssignedMediaPort int

	MediaAddr *net.UDPAddr
	MediaConn *net.UDPConn
	// contains filtered or unexported fields
}

func Dial

func Dial(targetHostname string, ftlPort int, channelID ChannelID, streamKey []byte) (conn *Conn, err error)

func (*Conn) Close

func (conn *Conn) Close() error

func (*Conn) Heartbeat

func (conn *Conn) Heartbeat() error

type ConnConfig

type ConnConfig struct {
	Handler Handler
}

type FtlConnection

type FtlConnection struct {
	Metadata *FtlConnectionMetadata
	// contains filtered or unexported fields
}

func (*FtlConnection) Close

func (conn *FtlConnection) Close() error

func (*FtlConnection) ProcessCommand

func (conn *FtlConnection) ProcessCommand(command string) error

func (*FtlConnection) SendMessage

func (conn *FtlConnection) SendMessage(message string) error

type FtlConnectionMetadata

type FtlConnectionMetadata struct {
	ProtocolVersion string
	VendorName      string
	VendorVersion   string

	HasVideo         bool
	VideoCodec       string
	VideoHeight      uint
	VideoWidth       uint
	VideoPayloadType uint8
	VideoIngestSsrc  uint

	HasAudio         bool
	AudioCodec       string
	AudioPayloadType uint8
	AudioIngestSsrc  uint
}

type Handler

type Handler interface {
	GetHmacKey() (string, error)

	OnConnect(ChannelID) error
	OnPlay(FtlConnectionMetadata) error
	OnVideo(*rtp.Packet) error
	OnAudio(*rtp.Packet) error
	OnClose()
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config *ServerConfig) *Server

func (*Server) Serve

func (srv *Server) Serve(listener net.Listener) error

type ServerConfig

type ServerConfig struct {
	Log logrus.FieldLogger
	// OnNewConnect is triggered on any connect to the FTL port, however it's not a
	// qualified FTL client until Handler.OnConnect is called.
	OnNewConnect func(net.Conn) (net.Conn, *ConnConfig)
}

type StreamID

type StreamID uint32

Jump to

Keyboard shortcuts

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