Documentation
¶
Index ¶
- Variables
- type WS
- func (ws *WS) ClientHandshake(ctx context.Context, host, endpoint string) error
- func (ws *WS) Close() error
- func (ws *WS) ReadMessage() (*WSMessage, error)
- func (ws *WS) SendBinary(binary []byte) error
- func (ws *WS) SendFrame(fin bool, opcode WSOpcode, payload []byte) error
- func (ws *WS) SendMessage(kind WSMessageKind, payload []byte) error
- func (ws *WS) SendText(text string) error
- func (ws *WS) ServerHandshake(ctx context.Context) error
- type WSFrameHeader
- type WSMessage
- type WSMessageKind
- type WSOpcode
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClientHandshakeBadAccept = errors.New("client handshake bad accept")
View Source
var ErrClientHandshakeBadResponse = errors.New("client handshake bad response")
Client Handshake Errors
View Source
var ErrClientHandshakeDuplicateAccept = errors.New("client handshake duplicate accept")
View Source
var ErrClientHandshakeNoAccept = errors.New("client handshake no accept")
View Source
var ErrCloseFrameSent = errors.New("close frame sent")
Connection Errors
View Source
var ErrControlFrameTooBig = errors.New("control frame too big")
View Source
var ErrInvalidUtf8 = errors.New("invalid utf-8")
View Source
var ErrReservedBitsNotNegotiated = errors.New("reserved bits not negotiated")
View Source
var ErrServerHandshakeBadRequest = errors.New("server handshake bad request")
Server Handshake Errors
View Source
var ErrServerHandshakeDuplicateKey = errors.New("server handshake duplicate key")
View Source
var ErrServerHandshakeNoKey = errors.New("server handshake no key")
View Source
var ErrShortUtf8 = errors.New("short utf-8")
utf-8 Errors
View Source
var ErrUnexpectedOpCode = errors.New("unexpected opcode")
Functions ¶
This section is empty.
Types ¶
type WS ¶
func (*WS) ClientHandshake ¶
func (*WS) ReadMessage ¶
func (*WS) SendBinary ¶
func (*WS) SendMessage ¶
func (ws *WS) SendMessage(kind WSMessageKind, payload []byte) error
type WSFrameHeader ¶
type WSFrameHeader struct {
// contains filtered or unexported fields
}
type WSMessage ¶
type WSMessage struct {
Kind WSMessageKind
Payload []byte
}
type WSMessageKind ¶
type WSMessageKind byte
const MessageBIN WSMessageKind = WSMessageKind(OpCodeBIN)
const MessageTEXT WSMessageKind = WSMessageKind(OpCodeTEXT)
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
chat
command
|
|
|
echo_client
command
|
|
|
echo_server
command
|
|
|
send_client
command
|
Click to show internal directories.
Click to hide internal directories.