rtmp

package
v0.0.0-...-aa312c8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package rtmp provides client and server implementation for RTMP message and chunk streams

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOptions

type ClientOptions struct {
	Connection *connection.Options
	Handshaker handshake.Handshaker
}

ClientOptions provide configuration for RTMP client

type Connection

type Connection interface {
	Recv(ctx context.Context) (*message.Raw, error)
	Send(ctx context.Context, msg *message.Raw) error
	Close() error
}

Connection interface provides RTMP connection methods for terminating connection and writing and reading messages

func Dial

func Dial(parent context.Context, remote string, options *ClientOptions) (conn Connection, err error)

Dial established new connection with remote RTMP server

type Server

type Server struct {
	Listener    net.Listener
	Options     ServerOptions
	Context     context.Context
	Cancel      context.CancelFunc
	Connections chan Connection
}

Server provides RTMP server implementation

func NewServer

func NewServer(parent context.Context, listener net.Listener, options *ServerOptions) *Server

NewServer returns new RTMP server using existing listener

func NewServerListen

func NewServerListen(parent context.Context, addr string, options *ServerOptions) (srv *Server, err error)

NewServerListen returns new RTMP server creating TCP listener on provided endpoint

func (*Server) Accept

func (srv *Server) Accept(ctx context.Context) (conn Connection, err error)

Accept blocks until context is expired, or new RTMP connection is established

type ServerOptions

type ServerOptions struct {
	Connection *connection.Options
	Handshaker handshake.Handshaker
}

ServerOptions provide configuration for RTMP server

Directories

Path Synopsis
Package chunk provides reading and writing messages using RTMP chunk streams
Package chunk provides reading and writing messages using RTMP chunk streams
Package connection provides connection layer for sending and receiving RTMP messages
Package connection provides connection layer for sending and receiving RTMP messages
Package handshake provides handshaker interface and default implementations for RTMP handshake stage
Package handshake provides handshaker interface and default implementations for RTMP handshake stage
Package message provides handling RTMP messages
Package message provides handling RTMP messages

Jump to

Keyboard shortcuts

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