Versions in this module Expand all Collapse all v0 v0.8.0 Jun 22, 2026 Changes in this version + const CloseGoingAway + const CloseInternalServerErr + const CloseInvalidFramePayloadData + const CloseMandatoryExtension + const CloseMessageTooBig + const CloseNoStatusReceived + const CloseNormalClosure + const ClosePolicyViolation + const CloseProtocolError + const CloseUnsupportedData + const OpcodeBinary + const OpcodeClose + const OpcodeContinuation + const OpcodePing + const OpcodePong + const OpcodeText + func IsValidUtf8(d []byte) bool + func Mask(data []byte, key []byte) + type Aggregator struct + func NewAggregator(maxsize uint) *Aggregator + func (a *Aggregator) Clear() + func (a *Aggregator) Received(data []byte) error + type Client struct + OnClose func() + OnError func(err error) + OnMessage func(data []byte) + OnOpen func() + func Upgrade(w http.ResponseWriter, r *http.Request) (*Client, error) + func (c *Client) Listen() + func (client *Client) Close() + func (client *Client) CloseWith(code uint16, reason string) error + func (client *Client) Ping() + func (client *Client) Pong(pingPayload []byte) + func (client *Client) SendBinary(data []byte) + func (client *Client) SendText(text string) + type Connect struct + func NewConnect(maxsize uint) *Connect + func (c *Connect) ReadHeader() (*FrameHeader, error) + func (c *Connect) ReadPayload(header *FrameHeader) ([]byte, error) + func (c *Connect) WriteFrame(opcode byte, isMasked bool, data []byte) error + type FrameHeader struct + Fin bool + Length uint64 + Masked bool + Opcode byte v0.7.0 Jun 22, 2026