websocket

package module
v0.0.0-...-62e1376 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConnection

func CreateConnection(options ConnectionOptions) (gen.MetaBehavior, error)

func CreateHandler

func CreateHandler(options HandlerOptions) meta.WebHandler

Types

type ConnectionOptions

type ConnectionOptions 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