websocket

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPCODE_CONTINUATION = 0x0
	OPCODE_FOR_TEXT     = 0x1
	OPCODE_BINARY       = 0x2
	OPCODE_CLOSE        = 0x8
	OPCODE_PING         = 0x9
	OPCODE_PONG         = 0xA
)

Variables

This section is empty.

Functions

func Run

func Run(path string, port string, socketHandler func(ws *Websocket))

Types

type Connection

type Connection interface {
	Close() error
}

type Frame

type Frame struct {
	Fin           byte
	Opcode        byte
	PayloadLength int
	Mask          []byte
	Payload       []byte
}

func (Frame) Text

func (f Frame) Text() string

type Websocket

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

func New

func (*Websocket) Close

func (ws *Websocket) Close() error

func (*Websocket) Recv

func (ws *Websocket) Recv() (Frame, error)

func (*Websocket) Send

func (ws *Websocket) Send(f Frame) error

Jump to

Keyboard shortcuts

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