websocket

package
v0.0.0-...-d828c9b Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient(options ClientOptions) (gen.MetaBehavior, error)

func CreateHandler

func CreateHandler(options HandlerOptions) meta.WebHandler

Types

type ClientOptions

type ClientOptions struct {
	Process           gen.Atom
	URL               url.URL
	HandshakeTimeout  time.Duration
	EnableCompression bool
}

type HandlerOptions

type HandlerOptions struct {
	ProcessPool       []gen.Atom
	HandshakeTimeout  time.Duration
	EnableCompression bool
	CheckOrigin       func(r *http.Request) bool
}

type Message

type Message struct {
	ID   gen.Alias
	Type MessageType
	Body []byte
}

type MessageConnect

type MessageConnect struct {
	ID         gen.Alias
	RemoteAddr net.Addr
	LocalAddr  net.Addr
}

type MessageDisconnect

type MessageDisconnect struct {
	ID gen.Alias
}

type MessageType

type MessageType int
const (
	MessageTypeText   MessageType = 1
	MessageTypeBinary MessageType = 2
	MessageTypeClose  MessageType = 8
	MessageTypePing   MessageType = 9
	MessageTypePong   MessageType = 10
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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