Categorygithub.com/monstercat/websocket
modulepackage
0.0.0-20211206205509-0e15ea6e49f7
Repository: https://github.com/monstercat/websocket.git
Documentation: pkg.go.dev

# README

websocket

This is a fork of nhooyr.io/websocket

# Packages

Package wsjson provides helpers for reading and writing JSON messages.
Package wspb provides helpers for reading and writing protobuf messages.

# Functions

Accept accepts a WebSocket handshake from a client and upgrades the the connection to a WebSocket.
CloseStatus is a convenience wrapper around Go 1.13's errors.As to grab the status code from a CloseError.
Dial performs a WebSocket handshake on url.
NetConn converts a *websocket.Conn into a net.Conn.

# Constants

CompressionContextTakeover uses a flate.Reader and flate.Writer per connection.
CompressionDisabled disables the deflate extension.
CompressionNoContextTakeover grabs a new flate.Reader and flate.Writer as needed for every message.
MessageBinary is for binary messages like protobufs.
MessageText is for UTF-8 encoded text messages like JSON.
StatusAbnormalClosure is exported for use only with Wasm.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
StatusNoStatusRcvd cannot be sent in a close message.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
StatusTLSHandshake is only exported for use with Wasm.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.
https://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number These are only the status codes defined by the protocol.

# Structs

AcceptOptions represents Accept's options.
CloseError is returned when the connection is closed with a status and reason.
Conn represents a WebSocket connection.
DialOptions represents Dial's options.

# Type aliases

CompressionMode represents the modes available to the deflate extension.
MessageType represents the type of a WebSocket message.
StatusCode represents a WebSocket status code.