wslib

package
v0.0.0-...-5870b03 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUpgrader

func NewUpgrader(f func(r *http.Request) bool) websocket.Upgrader

func SetCheckOrigin

func SetCheckOrigin(f func(r *http.Request) bool)

Types

type WsIns

type WsIns struct {
	HTTPCtx *hfw.HTTPContext
	// contains filtered or unexported fields
}

func NewWS

func NewWS(httpCtx *hfw.HTTPContext, h http.Header) (wsIns *WsIns, err error)

func NewWSWithUpgrader

func NewWSWithUpgrader(httpCtx *hfw.HTTPContext, h http.Header, upgrader websocket.Upgrader) (wsIns *WsIns, err error)

func (*WsIns) Close

func (wsIns *WsIns) Close() error

func (*WsIns) IsWebSocketCloseError

func (wsIns *WsIns) IsWebSocketCloseError(err error) bool

func (*WsIns) ReadMessage

func (wsIns *WsIns) ReadMessage() (messageType int, p []byte, err error)

func (*WsIns) WriteCloseMessage

func (wsIns *WsIns) WriteCloseMessage(closeCode int, text string) error

func (*WsIns) WritePingMessage

func (wsIns *WsIns) WritePingMessage() (err error)

func (*WsIns) WriteTextMessage

func (wsIns *WsIns) WriteTextMessage(data []byte) (err error)

Jump to

Keyboard shortcuts

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