websocket

package
v0.0.0-...-da72ffe Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TrafficHandler

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

TrafficHandler processes WebSocket traffic.

func NewTrafficHandler

func NewTrafficHandler(logger logger.Logger) *TrafficHandler

NewTrafficHandler creates a new instance of TrafficHandler.

func (*TrafficHandler) Handle

func (h *TrafficHandler) Handle(ctx *tcp.ConnectionContext, conn gnet.Conn) gnet.Action

type WsCodec

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

WsCodec handles WebSocket upgrades and frame decoding.

func NewWsCodec

func NewWsCodec(logger logger.Logger) *WsCodec

func (*WsCodec) Decode

func (w *WsCodec) Decode(c gnet.Conn) ([]wsutil.Message, error)

func (*WsCodec) ReadBufferBytes

func (w *WsCodec) ReadBufferBytes(c gnet.Conn) gnet.Action

func (*WsCodec) Upgrade

func (w *WsCodec) Upgrade(c gnet.Conn) (bool, gnet.Action)

func (*WsCodec) Upgraded

func (w *WsCodec) Upgraded() bool

Jump to

Keyboard shortcuts

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