rtmp

package
v0.0.0-...-6dc77ee Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const FlvTimestampMax = 0xFFFFFF

Variables

View Source
var CodecTypes = flv.CodecTypes
View Source
var Debug bool
View Source
var ErrServerClosed = errors.New("server closed")

Functions

func Handler

func Handler(h *avutil.RegisterHandler)

func ParseURL

func ParseURL(uri string) (u *url.URL, err error)

func SplitPath

func SplitPath(u *url.URL) (app, stream string)

Types

type Conn

type Conn struct {
	URL             *url.URL
	OnPlayOrPublish func(string, flvio.AMFMap) error
	// contains filtered or unexported fields
}

func Dial

func Dial(uri string, options DialOptions) (conn *Conn, err error)

func DialTimeout

func DialTimeout(uri string, timeout time.Duration, options DialOptions) (conn *Conn, err error)

func NewConn

func NewConn(netconn net.Conn) *Conn

func (*Conn) Close

func (conn *Conn) Close() (err error)

func (*Conn) GetMetaData

func (conn *Conn) GetMetaData() flvio.AMFMap

func (*Conn) LocalAddr

func (conn *Conn) LocalAddr() net.Addr

func (*Conn) NetConn

func (conn *Conn) NetConn() net.Conn

func (*Conn) Prepare

func (conn *Conn) Prepare() (err error)

func (*Conn) ReadPacket

func (conn *Conn) ReadPacket() (pkt av.Packet, err error)

func (*Conn) RemoteAddr

func (conn *Conn) RemoteAddr() net.Addr

func (*Conn) RxBytes

func (conn *Conn) RxBytes() uint64

func (*Conn) SetIdleTimeout

func (conn *Conn) SetIdleTimeout(d time.Duration) error

func (*Conn) SetMetaData

func (conn *Conn) SetMetaData(data flvio.AMFMap)

func (*Conn) SetReadIdleTimeout

func (conn *Conn) SetReadIdleTimeout(d time.Duration) error

func (*Conn) SetWriteIdleTimeout

func (conn *Conn) SetWriteIdleTimeout(d time.Duration) error

func (*Conn) Streams

func (conn *Conn) Streams() (streams []av.CodecData, err error)

func (*Conn) TxBytes

func (conn *Conn) TxBytes() uint64

func (*Conn) WriteHeader

func (conn *Conn) WriteHeader(streams []av.CodecData) (err error)

func (*Conn) WritePacket

func (conn *Conn) WritePacket(pkt av.Packet) (err error)

func (*Conn) WriteTrailer

func (conn *Conn) WriteTrailer() (err error)

type DialOptions

type DialOptions struct {
	MaxProbePacketCount int
	DebugChunks         func(conn net.Conn) bool
}

type Server

type Server struct {
	Addr          string
	TLSConfig     *tls.Config
	HandlePublish func(*Conn)
	HandlePlay    func(*Conn)
	HandleConn    func(*Conn)

	MaxProbePacketCount   int
	SkipInvalidMessages   bool
	DebugChunks           func(conn net.Conn) bool
	ConnectionIdleTimeout time.Duration
	// contains filtered or unexported fields
}

func (*Server) Close

func (s *Server) Close()

func (*Server) HandleNetConn

func (s *Server) HandleNetConn(netconn net.Conn) (err error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) ListenAndServeTLS

func (s *Server) ListenAndServeTLS(certFile, keyFile string) error

func (*Server) Serve

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

func (*Server) ServeTLS

func (s *Server) ServeTLS(listener net.Listener, certFile, keyFile string) error

Jump to

Keyboard shortcuts

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