websocketconn

package
v0.0.0-...-3d1188e Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

golang.org/x/net v0.14.0

Index

Constants

View Source
const (
	ProtocolVersionHybi13    = 13
	ProtocolVersionHybi      = ProtocolVersionHybi13
	SupportedProtocolVersion = "13"

	ContinuationFrame = 0
	TextFrame         = 1
	BinaryFrame       = 2
	CloseFrame        = 8
	PingFrame         = 9
	PongFrame         = 10
	UnknownFrame      = 255

	DefaultMaxPayloadBytes = 32 << 20 // 32MB
)

Variables

View Source
var (
	ErrBadProtocolVersion   = errors.New("bad protocol version")
	ErrBadScheme            = errors.New("bad scheme")
	ErrBadStatus            = errors.New("bad status")
	ErrBadUpgrade           = errors.New("missing or bad upgrade")
	ErrBadWebSocketOrigin   = errors.New("missing or bad WebSocket-Origin")
	ErrBadWebSocketLocation = errors.New("missing or bad WebSocket-Location")
	ErrBadWebSocketProtocol = errors.New("missing or bad WebSocket-Protocol")
	ErrBadWebSocketVersion  = errors.New("missing or bad WebSocket Version")
	ErrChallengeResponse    = errors.New("mismatch challenge/response")
	ErrBadFrame             = errors.New("bad frame")
	ErrBadFrameBoundary     = errors.New("not on frame boundary")
	ErrNotWebSocket         = errors.New("not websocket protocol")
	ErrBadRequestMethod     = errors.New("bad method")
	ErrNotSupported         = errors.New("not supported")
)
View Source
var (
	ErrBadMaskingKey         = errors.New("bad masking key")
	ErrBadPongMessage        = errors.New("bad pong message")
	ErrBadClosingStatus      = errors.New("bad closing status")
	ErrUnsupportedExtensions = errors.New("unsupported extensions")
	ErrNotImplemented        = errors.New("not implemented")
)

Functions

func Client

func Client(conn net.Conn, cfg *tls.Config) net.Conn

func Server

func Server(conn net.Conn, cfg *tls.Config) net.Conn

Types

type WebsocketConn

type WebsocketConn struct {
	MaxPayloadBytes int
	// contains filtered or unexported fields
}

func (*WebsocketConn) Close

func (wc *WebsocketConn) Close() (err error)

func (*WebsocketConn) HandShakeHandle

func (wc *WebsocketConn) HandShakeHandle() error

func (*WebsocketConn) LocalAddr

func (wc *WebsocketConn) LocalAddr() net.Addr

func (*WebsocketConn) Read

func (wc *WebsocketConn) Read(b []byte) (n int, err error)

func (*WebsocketConn) RemoteAddr

func (wc *WebsocketConn) RemoteAddr() net.Addr

func (*WebsocketConn) SetDeadline

func (wc *WebsocketConn) SetDeadline(t time.Time) error

func (*WebsocketConn) SetReadDeadline

func (wc *WebsocketConn) SetReadDeadline(t time.Time) error

func (*WebsocketConn) SetWriteDeadline

func (wc *WebsocketConn) SetWriteDeadline(t time.Time) error

func (*WebsocketConn) Write

func (wc *WebsocketConn) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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