zerows

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 7 Imported by: 0

README

zerows

Zero alloc Go Websocket client (using gobwas)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHeaderLengthMSB        = fmt.Errorf("header error: the most significant bit must be 0")
	ErrHeaderLengthUnexpected = fmt.Errorf("header error: unexpected payloadBuffer length bits")
)

Errors used by frame reader.

Functions

func HandlePayload

func HandlePayload(conn *net.Conn, length int) ([]byte, error)

func HandlePing

func HandlePing(conn *net.Conn) error

HandlePing answers a ping message with a pong message

func ReadHeader

func ReadHeader(r io.Reader) (h ws.Header, err error)

ReadHeader reads a frame header from r.

func ReadMessage added in v0.0.3

func ReadMessage(conn *net.Conn) (payload []byte, err error, connectionClosed bool)

ReadMessage reads an incoming message

func WriteHeader

func WriteHeader(w io.Writer, h ws.Header) error

WriteHeader writes header binary representation into w.

Types

This section is empty.

Jump to

Keyboard shortcuts

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