pushws

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWebsocketPingInterval     = 25 * time.Second
	DefaultWebsocketMessageSizeLimit = 1024 * 1024 // 1MB
)

Defaults.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ReadBufferSize is a parameter that is used for raw websocket Upgrader.
	// If set to zero reasonable default value will be used.
	ReadBufferSize int

	// WriteBufferSize is a parameter that is used for raw websocket Upgrader.
	// If set to zero reasonable default value will be used.
	WriteBufferSize int

	// MessageSizeLimit sets the maximum size in bytes of allowed message from client.
	// By default DefaultWebsocketMessageSizeLimit will be used.
	MessageSizeLimit int

	// CheckOrigin func to provide custom origin check logic,
	// zero value means same host check.
	CheckOrigin func(r *http.Request) bool

	// PingInterval sets interval server will send ping messages to clients.
	// By default DefaultWebsocketPingInterval will be used.
	PingInterval time.Duration
}

Config represents config for Handler.

type Handler

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

Handler handles WebSocket client connections that push data to Live.

func NewHandler

func NewHandler(managedStreamRunner *managedstream.Runner, c Config) *Handler

NewHandler creates new Handler.

func (*Handler) ServeHTTP

func (s *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type PipelinePushHandler

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

PipelinePushHandler handles WebSocket client connections that push data to Live Pipeline.

func NewPipelinePushHandler

func NewPipelinePushHandler(pipeline *pipeline.Pipeline, c Config) *PipelinePushHandler

NewPathHandler creates new PipelinePushHandler.

func (*PipelinePushHandler) ServeHTTP

func (s *PipelinePushHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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